fix: optimistic delete for developer apps#14350
Merged
Merged
Conversation
|
Instruments three key contest interactions following the existing
'Remix Contest:' event prefix and {remixContestId, trackId} property
shape used by the host/pick-winners events:
- REMIX_CONTEST_VIEW: contest page/screen first resolves trackId+eventId
- REMIX_CONTEST_ENTER: user taps Enter Contest / Upload Remix
- REMIX_CONTEST_VIEW_SUBMISSIONS: user opens the submissions tab
Mobile submissions-tab firing uses useFocusedTab from
react-native-collapsible-tab-view because the contest tabs mount
eagerly (lazy: false) — a plain mount effect would fire even for
users who only view the Details tab.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8edc8d6 to
f6bdd42
Compare
Remove the app from the list immediately on delete click rather than waiting for the API response. Restores previous state on error. Moves list update from onSuccess to onMutate (with cancelQueries to avoid race conditions) and adds onError rollback.
f6bdd42 to
a83ec1d
Compare
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14350.audius.workers.dev Unique preview for this PR (deployed from this branch). |
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.
Deleting a developer app was not removing it from the list until page refresh. The API call worked, but the list state was only updated in
onSuccesswhich waits for the server round-trip.Fix: Move the cache update to
onMutateso the app disappears immediately on click. AddedcancelQueriesto prevent stale refetches from overwriting the optimistic update, andonErrorto restore the previous list if the mutation fails.File changed:
packages/common/src/api/tan-query/developer-apps/useDeleteDeveloperApp.ts