Repository navigation
Resolve the Pro-sync variant from the live sign-in signal, not just the settings node (closes #1685) - #1886
Merged
Conversation
…he settings node (closes #1685) On a fresh Pro sign-in, the DatabaseSettingsNode's auth_status hydrates asynchronously — on a fresh webview it lags behind an already-live sign-in. The variant machine read authed solely from settings.auth_status, so during that window it resolved 'sign-in' and stripped the enable-sync / first-Pro consent affordance: a new Pro user (signed in, non-member, sync off) had no way to turn sync on from the GUI. Fall back to the daemon's WatchSyncStatus signal (proSync.userEmail, cleared to '' on sign-out): a live sign-in now resolves 'consent' even before the settings node hydrates, so the enable-sync pill + consent slot appear. Signed-out state (empty userEmail, unhydrated settings) still resolves 'sign-in' — the fallback does not false-positive. (The sibling symptom — the Invitations onboarding inbox showing instead of the consent flow — is already gated by the signedInNoAccess syncEnabled check.) Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
|
APPROVE (self-review, right-sized per merge policy — small, well-covered frontend variant-machine change).
|
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
On a fresh Pro sign-in (signed in, non-member, sync off), the enable-sync / first-Pro consent affordance did not appear — a new Pro user had no way to turn sync on from the GUI.
Root cause:
resolveProSyncVariantreadauthedsolely from the active database'sauth_status, which hydrates asynchronously. On a fresh webview it lags behind an already-live sign-in, so the machine briefly (or persistently) resolvedsign-ininstead ofconsent, stripping the enable-sync pill + consent slot.Fix: fall back to the daemon's live
WatchSyncStatussignal —proSync.userEmail(cleared to''on sign-out) — so a live sign-in resolvesconsenteven before the settings node hydrates:Signed-out state (empty
userEmail, unhydrated settings) still resolvessign-in— the fallback does not false-positive. The sibling symptom (Invitations onboarding inbox showing instead of the consent flow) is already gated by thesignedInNoAccesssyncEnabledcheck.Tests
ui-extensions.test.ts(3 new): signed-in-unhydrated → consent; live sign-in overrides staleauth_status:local→ consent; signed-out + unhydrated → sign-in (no false positive).proSync.userEmailreset in before/afterEach.The variant-resolution fix was live-validated in the original round-2 session ("consent modal ✅"); final interactive OAuth sign-in visual confirmation defers to a desktop session.
Closes #1685.
Co-Authored-By: Claude Opus 4.8 [email protected]