Repository navigation
fix: stop labeling the unordered default sort as "Newest" - #736
Open
smartcalsystems-sketch wants to merge 1 commit into
Open
smartcalsystems-sketch wants to merge 1 commit into
smartcalsystems-sketch wants to merge 1 commit into
Conversation
…geFi#702) SORT_LABELS.default was "Newest", but sortBounties's "default" case returns the array unchanged, and Bounty has no createdAt (or equivalent) field anywhere to sort by. The backend's listing query also has no ORDER BY, so order is whatever Postgres's heap returns and can change between requests. A real chronological sort needs a createdAt field exposed end-to-end from the backend first -- guessing at one here would be inventing a backend contract this repo doesn't control. Taking the issue's other suggested fix instead: stop the label from claiming an ordering that isn't there.
|
@smartcalsystems-sketch is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Problem
SORT_LABELS.default = "Newest", butsortBounties's"default"case returns the array unchanged, andBountyhas nocreatedAt(or equivalent) field anywhere to sort by. The backend's listing query also has noORDER BY, so the actual order is whatever Postgres's heap returns and can change between requests.Fix
The issue offers two options: sort by
createdAt(map it in the adapter), or rename the option. I went with renaming: adding a sort on a field that doesn't exist anywhere onBountytoday would mean guessing at a backend contract this frontend repo doesn't own, and a change that type-checks but silently no-ops against the real backend felt worse than an honest label."Default order"replaces"Newest"so the UI stops claiming an ordering guarantee that isn't implemented. A real "Newest" sort is a good follow-up oncecreatedAtis exposed end-to-end frommergefi-backend.Testing
newest/oldest/recent) that the code doesn't actually provide.bounty-query.test.tssuite: 23/23 passing (22 pre-existing + 1 new), zero regressions.tsc --noEmitandeslintclean on all changed/consuming files.Closes #702