Skip to content

fix: optimistic delete for developer apps#14350

Merged
dylanjeffers merged 2 commits into
mainfrom
fix/optimistic-delete-developer-app
May 21, 2026
Merged

fix: optimistic delete for developer apps#14350
dylanjeffers merged 2 commits into
mainfrom
fix/optimistic-delete-developer-app

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

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 onSuccess which waits for the server round-trip.

Fix: Move the cache update to onMutate so the app disappears immediately on click. Added cancelQueries to prevent stale refetches from overwriting the optimistic update, and onError to restore the previous list if the mutation fails.

File changed: packages/common/src/api/tan-query/developer-apps/useDeleteDeveloperApp.ts

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

⚠️ No Changeset found

Latest commit: a83ec1d

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

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>
@dylanjeffers dylanjeffers force-pushed the fix/optimistic-delete-developer-app branch from 8edc8d6 to f6bdd42 Compare May 21, 2026 00:01
@pull-request-size pull-request-size Bot added size/S and removed size/L labels May 21, 2026
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.
@dylanjeffers dylanjeffers force-pushed the fix/optimistic-delete-developer-app branch from f6bdd42 to a83ec1d Compare May 21, 2026 00:05
@dylanjeffers dylanjeffers merged commit 58de216 into main May 21, 2026
9 checks passed
@dylanjeffers dylanjeffers deleted the fix/optimistic-delete-developer-app branch May 21, 2026 00:13
@github-actions
Copy link
Copy Markdown
Contributor

🌐 Web preview ready

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

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

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