Skip to content

Commit f1e50be

Browse files
loganjLarry
andauthored
test(desktop): wait for channel head refresh before paging thread summary test (#7955)
🤖 ## Summary Main's Desktop Smoke E2E (4) job fails on `scroll-history.spec.ts` ("thread summary badge survives a retained older-history prepend"). This change fixes the test's timing. It does not change app code. When a channel opens, the app starts a live subscription. When that subscription is ready, the app fetches the newest page again, and that fetch replaces the whole loaded history. This test scrolled up before that refresh happened. On slower CI runners, the refresh came after the older page loaded but before it showed on screen. The older rows went away, the reader stayed at the top, and no more pages loaded. All three attempts failed that way. The test now calls `waitForMockChannelHeadReady` before it scrolls, like the other pagination tests in this file already do. That helper waits for the live subscription and its refresh to finish. ### Related issue Main CI failure at `15d44dcc` (https://github.com/block/buzz/actions/runs/36470599751/job/109092076235). The same failure was reported on #7827. ### Testing - Added temporary logs to see the order of events. Locally, the refresh ran after the older page had loaded: the loaded history went from 2 pages back to 1. The test passed only because it checked before the next render. With the wait, the refresh runs first and nothing replaces the loaded pages later. - `playwright test --project=smoke tests/e2e/scroll-history.spec.ts`: 18 passed. This test with `--repeat-each=8`: 8 passed. ### Follow-up (not in this PR) The app has the same race for real users. If someone scrolls up before the live subscription is ready, or during a reconnect, the refresh can drop the older history they loaded. If they are at the top of the list, paging stops until they scroll down and back up. Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
1 parent 9b1c4f9 commit f1e50be

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎desktop/tests/e2e/scroll-history.spec.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,6 +2172,13 @@ test("thread summary badge survives a retained older-history prepend", async ({
21722172

21732173
await page.getByTestId("channel-deep-history").click();
21742174
await expect(page.getByTestId("chat-title")).toHaveText("deep-history");
2175+
// Page only after live admission and its head refresh. That refresh
2176+
// replaces the window, so an earlier prepend can be discarded.
2177+
await waitForMockChannelHeadReady(
2178+
page,
2179+
"deep-history",
2180+
"feedf00d-0000-4000-8000-000000000007",
2181+
);
21752182
const timeline = page.getByTestId("message-timeline");
21762183
const badgeSelector =
21772184
'[data-testid="message-thread-summary"][data-thread-head-id="mock-deep-history-599"]';

0 commit comments

Comments
 (0)