Skip to content

fix(desktop): account-bound sync without the stale enablement flag - #3

Merged
ProAnima merged 4 commits into
mainfrom
port/account-sync
Oct 14, 2026
Merged

ProAnima merged 4 commits into
mainfrom
port/account-sync

Conversation

@ProAnima

Copy link
Copy Markdown
Owner

Summary

Ports the uncommitted 2026-08-21 desktop sync work onto the refactored main (the server half is in #2).

  • Single source of truth. The profiles.json sync_enabled flag is removed; stored per-account credentials decide whether an account syncs. Previously migrated accounts could look connected in Settings while background sync silently skipped them. Old profiles.json files still load (the extra field is ignored).
  • Account-switch safety. New server_sync/active_account.rs: creating or switching an account bumps a generation counter before the vault changes. A sync run re-checks account + generation before every write (exchange apply, cursor, blob upload/download, on-demand audio), so a response for account A can't land in account B's vault. The newly active account is synced right after the switch.
  • Serialized runs. Manual "Sync now" and background sync share one tokio::sync::Mutex gate.
  • Settings. The second "advanced" VDS login form (ServerAuthForm / ServerAccountCard / useServerAccount) is removed — it could attach a server identity unrelated to the active local account. Settings now shows the account toggle, the connected email with a "Sync now" button, and account deletion behind password confirmation.
  • i18n: system theme description no longer says "Windows"; sync error and secure-note texts updated (ru/en, other locales fall back to en).
  • Docs: v1-release-plan.md records this fix and the 2026-08-21 VDS stability rollout.

Test plan

  • scripts/check.ps1 — frontend (tsc, eslint, vitest 132), desktop-rust (fmt, clippy, 135 tests incl. new sync_context_expires_when_the_active_account_changes), server (fmt, clippy, tests)
  • Physical two-account / two-device VDS pass (blocker 3 in the release plan)

🤖 Generated with Claude Code

Feargin and others added 4 commits October 14, 2026 16:59
The profiles.json sync_enabled flag could disagree with the stored
per-account server session: migrated accounts looked connected in
Settings while background sync silently skipped them. Credentials are
now the single source of truth.

Switching or creating an account bumps an account generation before
the vault changes, so an in-flight run for the previous account can no
longer write its response, cursor or blobs into the new vault, and the
newly active account is synced right away. Manual and background runs
share one serialized gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the second "advanced" VDS login form: it could attach a server
identity unrelated to the active local account. Settings now offers the
account toggle, the connected email with a manual "Sync now" button,
and account deletion behind password confirmation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ProAnima
ProAnima merged commit acf9a1b into main Oct 14, 2026
3 checks passed
@ProAnima
ProAnima deleted the port/account-sync branch October 14, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants