fix: falsy ids omitted for search params#31
Merged
WilliamKelley merged 1 commit intomainfrom Mar 26, 2026
Merged
Conversation
In interview, candidate encountered problem when changing `page_size` to `1` on the client. Their code was identical to the solution so something was up. Turns out the client api implementation has a bug where falsy parameters weren't serialized to the URL. Since the first project's `id` is `0`, then the offset parameter wasn't transmitted. Another invisible symptom of this bug is that the first user, "James Smith", would never work with the filter control since their `userId` was `0`. But this was never apparent because they're coded to have zero projects anyways.
cpimhoff
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In interview, candidate encountered problem when changing
page_sizeto1on the client. Their code was identical to the solution so something was up. Turns out the client api implementation has a bug where falsy parameters weren't serialized to the URL. Since the first project'sidis0, then the offset parameter wasn't transmitted.Another invisible symptom of this bug is that the first user, "James Smith", would never work with the filter control since their
userIdwas0. But this was never apparent because they're coded to have zero projects anyways.This bug is not present in the typescript version of the interview because there's not an actual server or parameter serialization. Using the same language for server and client means that parameters were just passed to the function invocation directly.