From 26eff09d7d1b7392b9d90c58b056921e9269ba08 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Mar 2026 18:44:15 +0000 Subject: [PATCH] fix: resolve race condition in offline sync e2e test Set up waitForResponse before calling setOffline(false) so the sync response listener is registered before the online event fires. https://claude.ai/code/session_014yTnHzjkCJLBcYcPTSLVkE --- tests/e2e/offline.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/offline.spec.ts b/tests/e2e/offline.spec.ts index 0f03b5f..2bcf874 100644 --- a/tests/e2e/offline.spec.ts +++ b/tests/e2e/offline.spec.ts @@ -62,8 +62,9 @@ test.describe('Offline Support', () => { await expect(page.getByText('Survive Reload')).toBeVisible(); // When the network is restored and sync completes + const syncResponse = page.waitForResponse('**/api/sync'); await page.context().setOffline(false); - await page.waitForResponse('**/api/sync'); + await syncResponse; // And the user reloads the page await page.reload();