fix: correct sort order default to descending (#17)#20
Open
harishkotra wants to merge 1 commit intoPolymarket:mainfrom
Open
fix: correct sort order default to descending (#17)#20harishkotra wants to merge 1 commit intoPolymarket:mainfrom
harishkotra wants to merge 1 commit intoPolymarket:mainfrom
Conversation
3a8ef1d to
836513b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Changed default sort direction from ascending to descending for markets, events, comments, and series list commands - When --ascending flag is NOT provided: sorts in descending order (default behavior) - When --ascending flag IS provided: sorts in ascending order (explicit override) - Help text already stated 'Sort ascending instead of descending', implying descending is default - Fixes issue where --ascending flag was a no-op and no way to get descending results - Simplified conditional logic using Some(ascending) instead of if/else
836513b to
ed08ace
Compare
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.
PR for fixing #17
Changed the default sort direction from ascending to descending in both commands:
--ascendingflag: Results sort in descending order (default)--ascendingflag: Results sort in ascending order (explicit override)markets.rsMarketsCommand::List behaviorevents.rsEventsCommand::List behavior--ascendingflag has no counterpart; sort defaults to ascending with no way to sort descending #17.Note
Low Risk
Small, localized change to request construction for list endpoints; risk is limited to potentially changing default ordering behavior in CLI output.
Overview
Fixes list-command sort direction handling by always sending an explicit
ascendingvalue to the SDK.Across
comments,events,markets, andserieslist flows,maybe_ascendingnow receivesSome(ascending)instead ofNonewhen the flag is not set, aligning behavior with the CLI help text (default descending unless--ascendingis provided).Written by Cursor Bugbot for commit ed08ace. This will update automatically on new commits. Configure here.