diff options
| author | Adam Malczewski <[email protected]> | 2026-06-28 15:26:40 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-28 15:26:40 +0900 |
| commit | 22a8dbf96dda066dc5027694b1fe512df9f3fc11 (patch) | |
| tree | ac6a534d2f88b99e6d93adeba54948cca276fcfb /src/app | |
| parent | ed3425cb8ed57862f954505831be38a2588729bd (diff) | |
| parent | 7300c233ab2ce3e3d20fef9b6b051e36a509bcdc (diff) | |
| download | dispatch-web-22a8dbf96dda066dc5027694b1fe512df9f3fc11.tar.gz dispatch-web-22a8dbf96dda066dc5027694b1fe512df9f3fc11.zip | |
Merge branch 'feature/cache-display-fix' into predev
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/store.test.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/app/store.test.ts b/src/app/store.test.ts index 2cf473c..e1a11e0 100644 --- a/src/app/store.test.ts +++ b/src/app/store.test.ts @@ -553,13 +553,17 @@ describe("createAppStore", () => { event: { type: "turn-sealed", conversationId: convId, turnId: "turn-1" }, }); - await new Promise((r) => setTimeout(r, 50)); - - expect(fetchedUrls.some((u) => u.includes(`/conversations/${convId}?sinceSeq=`))).toBe(true); - - await new Promise((r) => setTimeout(r, 50)); + // `turn-sealed` triggers an async `syncTail` (cache.sinceSeq → historySync + // → cache.commit → applyHistory). Poll for the side-effect rather than + // guessing a fixed delay — under suite load a fixed `setTimeout` raced the + // fetch chain and flaked here. + await vi.waitFor(() => { + expect(fetchedUrls.some((u) => u.includes(`/conversations/${convId}?sinceSeq=`))).toBe(true); + }); - expect(store.activeChat.chunks.length).toBeGreaterThan(0); + await vi.waitFor(() => { + expect(store.activeChat.chunks.length).toBeGreaterThan(0); + }); store.dispose(); }); |
