Skip to content

feat: switch between multiple Google accounts without re-signing in - #118

Merged
noFAYZ merged 2 commits into
mainfrom
feat/google-account-switching-94
Aug 26, 2026
Merged

noFAYZ merged 2 commits into
mainfrom
feat/google-account-switching-94

Conversation

@noFAYZ

@noFAYZ noFAYZ commented Aug 26, 2026

Copy link
Copy Markdown
Owner

What and why

Closes #94. Today, using two YouTube Music accounts means a full sign-out/sign-in each time. This adds real multi-account storage and a switcher, so switching is instant.

How

  • Storage: a JSON YoutubeAccountStore (per-account slot id, cookie, cached name/avatar) replaces the single bare cookie, through the exact same encrypted-file (macOS) / OS-keyring (Windows/Linux) transport — the orphan-recovery fix from Unable to login to youtube on mac os #116 covers it unchanged. An existing install's bare cookie migrates into one pinned slot automatically.
  • Isolation: every account gets its own login webview partition. Sign-in always opens a fresh, empty one, so Google can only ever show a clean login screen — never silently continue a different account's session. Re-authenticating an account you already have merges into its existing slot instead of duplicating it.
  • Concurrency: every store mutation (sign-in, switch, remove, and the ambient cookie-rotation persist) goes through one mutex — no lost-update races between them.
  • sign_in_youtube_music keeps its signature (now inherently additive); new list/switch/remove_youtube_music_account commands handle the rest.
  • Frontend: listGoogleAccounts/switchGoogleAccount/removeGoogleAccount, separate from the existing channel-level switcher (brand channels within one login — untouched). A GoogleAccountSwitcher sits in the title bar (switch only) and Settings (switch + remove + add).

Scope

Switching still does a full library resync rather than an instant cached view per account — the issue asked to avoid re-login, not for per-account caching, and namespacing the whole offline cache is a separable, larger change.

How it was checked

  • cargo check / cargo test — 44/44 pass (16 new, covering the store's upsert/remove/switch/migration logic directly — it's pure, no AppHandle needed)
  • npm run verify — typecheck clean, 32/32 self-checks pass (1 new)
  • Not yet run against real Google infra in this environment — the interactive sign-in/multi-partition behavior is unverified end-to-end; flagging rather than claiming it

noFAYZ added 2 commits August 27, 2026 00:49
Backend now stores every signed-in Google account (JSON store, same
encrypted-file/keyring transport as before) instead of one, each with
its own isolated login webview partition so accounts can never
cross-contaminate. Sign-in stays one additive operation; new
switch/remove/list commands handle the rest. Legacy single-account
installs migrate transparently and keep their original webview
partition.

Frontend gets listGoogleAccounts/switchGoogleAccount/removeGoogleAccount
on top of the existing (unrelated) channel switcher, plus a
GoogleAccountSwitcher in the title bar and Settings.

16 new Rust tests on the store logic, 1 new TS check on the
switch/remove outcome branch.

Closes #94
Both switchers rendered as one undifferentiated list in the title bar
popover. Each now carries its own optional section label, rendered
only alongside its own rows so a hidden single-option section never
leaves an orphaned header. Settings' switchers use the same prop
instead of duplicating the header markup.
@vercel

vercel Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zuno Ready Ready Preview Aug 26, 2026 8:58pm

@noFAYZ
noFAYZ merged commit 8d2cd71 into main Aug 26, 2026
10 checks passed

This branch was successfully deployed

1 active deployment
Preview — d9f6fde3 Deployed Aug 26, 2026 by vercel[bot]
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.

Account switching

1 participant