profile: scope Contests tab to its own host endpoint#14262
Open
dylanjeffers wants to merge 2 commits intomainfrom
Open
profile: scope Contests tab to its own host endpoint#14262dylanjeffers wants to merge 2 commits intomainfrom
dylanjeffers wants to merge 2 commits intomainfrom
Conversation
Match the union of filters (genre, mood, key, bpm, isPremium, hasDownloads, isVerified) on both web and mobile so the All tab isn't forced to clear filters when switching off a sub-category. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previously the profile "Contests" tab pulled the global remix-contest
list and filtered client-side by host userId, with auto-pagination as a
workaround for ended-only artists whose contests sat past the first
page. Now it calls GET /v1/users/{id}/contests via the new SDK method
sdk.users.getContestsByUser, which filters at the database layer — no
more client-side filtering, no more MAX_PAGES_TO_LOAD escape hatch.
Adds useUserRemixContests in @audius/common with the same priming flow
(events, useRemixes entry-counts, primeRelatedData) as
useAllRemixContests, so ContestCard remains a synchronous cache hit.
Replaces the desktop, mobile-web, and React Native ContestsTab
implementations with the simpler one-call version. SDK regen pulls in
the new endpoint definition (paired with audius/api PR for the new
endpoint and the same swagger entry).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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
GET /v1/users/{id}/contests(SDK:sdk.users.getContestsByUser).useUserRemixContestsin@audius/commonwith the same prime-on-fetch flow (primeRelatedData, event cache, useRemixes entry-counts) asuseAllRemixContests, so ContestCard stays a synchronous cache hit.MAX_PAGES_TO_LOADauto-pagination workaround and per-rowHostedContestCardhost-guard that existed because the old endpoint couldn't filter by host. Updates desktop, mobile-web, and React Native consumers.Pairs with audius/api#790 which adds the underlying endpoint + swagger entry.
Test plan
🤖 Generated with Claude Code