Skip to content

fix(web): use relative paths when navigating after contest submit#14377

Merged
dylanjeffers merged 2 commits into
mainfrom
claude/flamboyant-euler-20b016
May 22, 2026
Merged

fix(web): use relative paths when navigating after contest submit#14377
dylanjeffers merged 2 commits into
mainfrom
claude/flamboyant-euler-20b016

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • Submitting / cancelling / deleting a contest navigated to a full absolute URL (http://audius.co/...) via react-router's navigate(), which treats it as a relative path. Result: blank screens at malformed URLs like /host-contest/https:/audius.co/<handle>/contest/<slug>.
  • Switched the three navigate() calls in HostRemixContestPage.tsx from fullContestPage / fullTrackPage to the relative contestPage helper (and the raw permalink for the track-page redirect).
  • fullContestPage / fullTrackPage remain valid for share/canonical URLs — they should just never be passed to navigate().

Test plan

  • Create a new remix contest from /host-contest (track-less entry) and submit → lands on the contest page (/<handle>/contest/<slug>), not a blank page.
  • Create a contest from /<handle>/<slug>/host-contest and submit → lands on the contest page.
  • Edit an existing contest and submit → lands on the contest page.
  • Cancel during create → lands on the track page (/<handle>/<slug>).
  • Cancel during edit → lands on the contest page.
  • Delete a contest → lands on the track page.
  • Cancel with no permalink (track-less, no source track chosen yet) → lands on /contests.

🤖 Generated with Claude Code

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>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

⚠️ No Changeset found

Latest commit: 98102f2

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14377.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

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>
@pull-request-size pull-request-size Bot added size/M and removed size/S labels May 21, 2026
@dylanjeffers dylanjeffers merged commit e2a1e25 into main May 22, 2026
13 checks passed
@dylanjeffers dylanjeffers deleted the claude/flamboyant-euler-20b016 branch May 22, 2026 02:16
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