Skip to content

profile: scope Contests tab to its own host endpoint#14262

Open
dylanjeffers wants to merge 2 commits intomainfrom
claude/blissful-northcutt-3c1406
Open

profile: scope Contests tab to its own host endpoint#14262
dylanjeffers wants to merge 2 commits intomainfrom
claude/blissful-northcutt-3c1406

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • Replaces the profile Contests tab's global-list-then-filter approach with a single call to the new server-scoped endpoint GET /v1/users/{id}/contests (SDK: sdk.users.getContestsByUser).
  • Adds useUserRemixContests in @audius/common with the same prime-on-fetch flow (primeRelatedData, event cache, useRemixes entry-counts) as useAllRemixContests, so ContestCard stays a synchronous cache hit.
  • Removes the MAX_PAGES_TO_LOAD auto-pagination workaround and per-row HostedContestCard host-guard that existed because the old endpoint couldn't filter by host. Updates desktop, mobile-web, and React Native consumers.
  • SDK regen pulls in the new endpoint definition.

Pairs with audius/api#790 which adds the underlying endpoint + swagger entry.

Test plan

  • Visit a profile that hosts contests, switch to the Contests tab — list renders without first paging through unrelated contests
  • Visit a profile that has only ended contests — they appear (the old workaround pulled up to 5 pages of the global list to surface these)
  • Visit a profile that has hosted no contests — empty state renders
  • Active-then-ended ordering preserved
  • Confirm same behavior on mobile-web and React Native profile screens

🤖 Generated with Claude Code

dylanjeffers and others added 2 commits May 6, 2026 13:13
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>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 1135d70

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant