Skip to content

Commit 3d8699e

Browse files
johnmatthewtennantDamonclaude
authored
test(unread): read a channel whose first history page is all joins (#2024)
Signed-off-by: John Tennant <[email protected]> Co-authored-by: Damon <8a08290d889f1c68921542bfe9631d4cd671be9bea5f1114951f386819e4c10a@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent aceb6fa commit 3d8699e

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎tests/browser/unread.spec.mjs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,33 @@ test.describe("automatic catch-up after membership rows", () => {
503503
});
504504
});
505505

506+
// AIDA-2318: a burst of joins filled the first history page, so the messages
507+
// unread counted never loaded and opening the channel could not read them.
508+
test.describe("a join burst longer than a history page", () => {
509+
test.use({ membershipBurst: 40, historyCounts: { [alphaId]: 20, beta: 1 } });
510+
test("opening the channel reads the messages behind the joins", async ({
511+
page,
512+
app,
513+
}) => {
514+
// Startup focus would read Alpha before the unread baseline is observed.
515+
await holdReadingFocus(page);
516+
await open(page, app);
517+
await expect(alpha(page).locator("[data-channel-unread]")).toHaveCount(1);
518+
await releaseReadingFocus(page);
519+
await composer(page).focus();
520+
const latest = app.histories
521+
.get(`primary/${alphaId}`)
522+
.findLast((row) => row.kind === 9);
523+
await expect
524+
.poll(
525+
async () =>
526+
(await journal(page))?.state.frontiers[`activity:${alphaId}`],
527+
)
528+
.toBe(latest.created_at);
529+
await expect(alpha(page).locator("[data-channel-unread]")).toHaveCount(0);
530+
});
531+
});
532+
506533
// Browser boundary: real app reading → strict IndexedDB under pressure → reload.
507534
// Lower-layer tests own unseen/manual/override matrices; no new fixture controls.
508535
test.describe("local receipt reserve", () => {

0 commit comments

Comments
 (0)