From 13a3d16ffc88845d7bc65fb0778da9aaff53b653 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sat, 2 May 2026 11:31:42 +0900
Subject: feat(auth): clear local IndexedDB and sync state on explicit logout

Wipe Dexie databases (main + CRDT sync state) and reset the sync queue
when the user explicitly logs out so the next account on the same device
starts from a clean local store. Session expiry deliberately keeps local
data intact so a returning user finds their offline work waiting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---
 src/client/pages/HomePage.test.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/client/pages/HomePage.test.tsx')

diff --git a/src/client/pages/HomePage.test.tsx b/src/client/pages/HomePage.test.tsx
index 3b053f0..7628a75 100644
--- a/src/client/pages/HomePage.test.tsx
+++ b/src/client/pages/HomePage.test.tsx
@@ -239,7 +239,9 @@ describe("HomePage", () => {
 
 		await user.click(screen.getByRole("button", { name: "Logout" }));
 
-		expect(apiClient.logout).toHaveBeenCalled();
+		await waitFor(() => {
+			expect(apiClient.logout).toHaveBeenCalled();
+		});
 	});
 
 	it("does not show description if deck has none", () => {
-- 
cgit v1.3.1

