From eb8faa3398d401804ddd0b4d4b94999f76dda578 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Tue, 12 May 2026 10:37:34 +0200 Subject: [PATCH] fix(accounts): refresh snapshot by email even when not active Previously the relogin path only refreshed a matching-email snapshot when it was the active one. Re-logging into a non-active account whose canonical email-shaped snapshot already existed threw SnapshotEmailMismatchError. Drop the activeName gate so any snapshot whose recorded email matches the incoming auth email is refreshed in-place. --- src/lib/accounts/account-service.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/accounts/account-service.ts b/src/lib/accounts/account-service.ts index a88c740..f0bbece 100644 --- a/src/lib/accounts/account-service.ts +++ b/src/lib/accounts/account-service.ts @@ -1037,10 +1037,10 @@ export class AccountService { }; } - if (!emailMatch && activeName === name && this.snapshotsShareEmail(existingSnapshot, incomingSnapshot)) { + if (!emailMatch && this.snapshotsShareEmail(existingSnapshot, incomingSnapshot)) { emailMatch = { name, - source: "active", + source: activeName === name ? "active" : "existing", forceOverwrite: true, }; } @@ -1070,12 +1070,11 @@ export class AccountService { if ( !activeEmailMatch && - activeName === name && this.registryEntrySharesEmail(entry, incomingSnapshot) ) { activeEmailMatch = { name, - source: "active", + source: activeName === name ? "active" : "existing", forceOverwrite: true, }; }