JamesReviewsMusic
JRM-50Proper optimistic bookmark toggle with rollback
Description
The bookmark button keeps its own isBookmarked useState, flips it before the mutation fires, and never reverts if the request fails, so the icon can lie until the next refetch. Both mutations also invalidate the entire ["bookmarks"] cache, refetching every bookmark query on screen for a single toggle.
- Derive bookmarked state from the query data instead of local state
- Use onMutate/onError/onSettled for a real optimistic update with rollback, and a toast on failure
- Invalidate only the affected album's status via the query key factory
Sub-tickets
0No sub-tickets yet.
Links
No links.
Comments
0No comments yet.