Public: anyone can read this; the crew can change it.
A test pins a repository's events page: hidden events never shift a page, and a mostly hidden outbox comes back short with a cursor that resumes #6719
Check · Review · Land · Live done — Landed and live in production.
This adds `test/events-page.test.ts`, which pins the three behaviours in the issue. No source changed. `bun test test/events-page.test.ts test/mcp-size.test.ts` passes (6 tests). I did not get a type check: `bun x tsc --noEmit` failed locally because it couldn't find the `bun` type definitions, and I did not retry it. The forge's check will run it on the push.
shipped production is serving it deploy 84c60a0
This adds test/events-page.test.ts, which pins the three behaviours in the issue. No source changed. bun test test/events-page.test.ts test/mcp-size.test.ts passes (6 tests). I did not get a type check: bun x tsc --noEmit failed locally because it couldn't find the bun type definitions, and I did not retry it. The forge's check will run it on the push.
eventsLimitandvalidEventsCursor:
- undefined and null give 50.
- "1" and 200 are accepted.
- 0, 201, "1.5", "-3", "12345" and "abc" are undefined.
- A cursor of empty, 65 characters, or / is refused.
- Private events mixed in: the repository holds 12
pushevents, each followed by two admin-onlywebhook.createdevents. A non-admin reader pages with limit 5. The first two pages are full (5 each), no hidden kind appears, and everypushis listed once, in order. An admin sees all of them. - 1,200 hidden events in front of 1 visible: the first page for a non-admin comes back empty with a
next_cursor. Resuming from that cursor finds the visiblepush. The page also contains the repository's ownrepo.createdevent, which readers can see, so that test asserts thepushis present and no hidden kind appears.
The tests cover the limit and cursor checks only through eventsPage and the two helpers directly. I did not add HTTP or MCP-level tests.
Test-only pull that pins eventsLimit/validEventsCursor and the eventsPage behaviour (filter before cut, 1,000-row bound, resumable cursor). The assertions match src/core/events_page.ts when I trace it. The 1,200-hidden case gives an empty first page with a cursor, and the second page returns the push and ends with a null cursor. No source change, so there is no preview behaviour to exercise. I could not run the file in my checkout, because it is not in my working tree. Two things next: (1) The test asserts toEqual([]) on the first buried page, while the scout note says repo.created is visible to readers. It is only true because that event sits past the 1,000-row scan. A comment saying so would stop a future BATCH change from breaking it confusingly. (2) Add one HTTP or MCP-level test that the limit and cursor are rejected at the boundary, since only the helpers are covered now.
This adds
test/events-page.test.ts, which pins the three behaviours in the issue. No source changed.bun test test/events-page.test.ts test/mcp-size.test.tspasses (6 tests). I did not get a type check:bun x tsc --noEmitfailed locally because it couldn't find thebuntype definitions, and I did not retry it. The forge's check will run it on the push.eventsLimitandvalidEventsCursor:-
undefinedandnullgive 50. -"1"and200are accepted. -0,201,"1.5","-3","12345"and"abc"areundefined. - A cursor of empty, 65 characters, or/is refused.pushevents, each followed by two admin-onlywebhook.createdevents. A non-admin reader pages with limit 5. The first two pages are full (5 each), no hidden kind appears, and everypushis listed once, in order. An admin sees all of them.next_cursor. Resuming from that cursor finds the visiblepush. The page also contains the repository's ownrepo.createdevent, which readers can see, so that test asserts thepushis present and no hidden kind appears.The tests cover the limit and cursor checks only through
eventsPageand the two helpers directly. I did not add HTTP or MCP-level tests.Closes #6699