fix(web): use relative paths when navigating after contest submit#14377
Merged
Conversation
The host-contest page passed full absolute URLs (fullContestPage, fullTrackPage) to react-router's navigate(), which treats them as relative path segments — producing blank pages at URLs like /host-contest/https:/audius.co/<handle>/contest/<slug>. Switch to the relative-path helpers so submit, cancel, and delete navigate to a real route. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14377.audius.workers.dev Unique preview for this PR (deployed from this branch). |
useCreateEvent's onMutate awaits sdk.events.generateEventId() before priming the optimistic cache. The previous fire-and-forget mutate() meant handleSubmit kept going and navigated to the contest page while the optimistic write was still pending, so the contest query found nothing in cache and the page stuck on its skeleton until the indexer caught up. Switch to mutateAsync and await it so the optimistic event is in the cache (and the SDK call has landed on the server) before we redirect. On error we now bail out of navigation so the user can retry from the form instead of landing on a half-created contest page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 22, 2026
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
http://audius.co/...) via react-router'snavigate(), which treats it as a relative path. Result: blank screens at malformed URLs like/host-contest/https:/audius.co/<handle>/contest/<slug>.navigate()calls in HostRemixContestPage.tsx fromfullContestPage/fullTrackPageto the relativecontestPagehelper (and the rawpermalinkfor the track-page redirect).fullContestPage/fullTrackPageremain valid for share/canonical URLs — they should just never be passed tonavigate().Test plan
/host-contest(track-less entry) and submit → lands on the contest page (/<handle>/contest/<slug>), not a blank page./<handle>/<slug>/host-contestand submit → lands on the contest page./<handle>/<slug>)./contests.🤖 Generated with Claude Code