Repository navigation
fix(bounties): reject unknown status filter with 400 instead of silent active fallback (fixes #1099) - #1102
Open
aipd506 wants to merge 2 commits into
Open
fix(bounties): reject unknown status filter with 400 instead of silent active fallback (fixes #1099)#1102aipd506 wants to merge 2 commits into
aipd506 wants to merge 2 commits into
Conversation
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.
Summary
Fixes #1099
Rejects unknown
statusquery parameters onGET /api/bountieswith a400 Bad Requestand an explicit error message containingvalid_values, instead of silently falling back to the active set.Problem
Previously, unrecognized status values (such as
?status=zzzz,?status=completed,?status=accepted) silently fell through to"active", returning a plausible200 OKresponse with active bounties. This caused caller confusion and subtle statistics corruption when consumers queried what they believed were valid statuses.Solution
app/api/bounties/route.ts, ifstatusis explicitly provided in query params and is not inSTATUS_FILTER_VALUES, return400 Bad Requestwith structured error details and allowed enum values.app/api/bounties/__tests__/route.test.tsverifying rejection of unknown statuses (status=zzzz) with400, acceptance of supported status filters (status=open) with200, and default fallback to"active"when thestatusparam is omitted (?limit=10).Contributor Attribution