fix: Prevent anonymous sign-in cancellation during onboarding#96
Open
justanotheratom wants to merge 1 commit intomainfrom
Open
fix: Prevent anonymous sign-in cancellation during onboarding#96justanotheratom wants to merge 1 commit intomainfrom
justanotheratom wants to merge 1 commit intomainfrom
Conversation
Sign-in was getting cancelled when users tapped buttons on the .whosThisFor screen because .task(id:) cancels in-flight work on route change. Fix by wrapping sign-in in an unstructured Task that survives cancellation, gating button actions on sign-in completion, and deduplicating concurrent callers. Also removes dead legacy guest sign-in code (signInWithLegacyGuest, clearAnonymousCredentials, anonUserNameKey/anonPasswordKey) — nothing ever wrote those keychain keys. Co-Authored-By: Claude Opus 4.6 <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.
Summary
Taskso.task(id:)cancellation (from route changes) no longer kills the in-flight network requestsignIn()completion with a session nil-check, preventingauthErroron downstream API callssignIn()callers via a stored@MainActortask handleSessionreturned by Supabase directly instead of discarding it, so session is set beforesignIn()returns (no reliance on async watcher)signInWithLegacyGuest,clearAnonymousCredentials, keychain keys) — nothing ever wrote those keysTest plan
signInAnonymouslyshould NOT show "cancelled",createFamilyshould succeedsignInAnonymouslycalls when pre-warm and button both trigger🤖 Generated with Claude Code