Repository navigation
fix(auth): merge guest favorites in the background on login (v5.2.6) - #138
Merged
Merged
Conversation
Signing in ran the guest→account favorites merge inside the login mutation's onSuccess and awaited every add, so mutateAsync (and the sign-in button) hung while a long on-device list uploaded. Fire the merge in the background instead: login resolves immediately, the adds settle, then the list is cleared and the favorites query refetched. Server-side adds are idempotent, so backgrounding cannot duplicate a favorite. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Bug check follow-up
Reviewed the v5.2.4/v5.2.5 changes. One real bug found and fixed:
Login hangs on the favorites merge. The guest→account favorites merge ran inside the login mutation's
onSuccessandawaited everyaddFavorite, somutateAsync(and the sign-in button) waited while a long on-device list uploaded. Now the merge runs in the background — login resolves immediately, adds settle, then the list is cleared and the favorites query refetched. Server-side adds are idempotent, so backgrounding cannot duplicate a favorite.Also reviewed and found acceptable / not bugs: route ordering in
users.py(distinct path depths, no shadowing), avatar304path (returns before decode), the favorites cache-key split (invalidation still prefix-matches both), the guest-favorites cap (100 < the 120/min write limit, so a merge never trips rate limiting), and.has()owner filtering (ownerless seed rows are excluded until the curator backfill, which runs the same startup).Bump to v5.2.6 (frontend-only fix).
🤖 Generated with Claude Code