test(e2e): drop only the initial review snapshot

The connection-review race fixture predates task chat bootstrap. It leaves the bootstrap snapshot untouched and instead discards the first recovery poll, which postpones the approval card until a second 20-second interval and makes CI hit its 45-second assertion deadline.

Apply the empty interaction snapshot once across either bootstrap or the standalone endpoint. Preserve the rest of the bootstrap and keep dropping the live creation event. The first recovery poll can now reveal the review, with all approval and continuation assertions unchanged.

The complete decline journey passes in Chromium. Traces show the first useful review read after about 21 seconds, versus about 41 seconds with the old fixture. The E2E test project typecheck passes.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Devin FoleyandPaperclip committed 2026-12-04 18:11:33 -08:00
1 parent e9fced7867
commit cfdbbb2283
1 file changed
+11 -6
+11 -6
View File
@@ -115,15 +115,19 @@ for (const journey of [
"Use connection-reviews.config.ts for controlled server restart",
);
let suppressReviewEvents = journey === "decline";
let initialSnapshotReturned = false;
if (journey === "decline") {
// Reproduce a review arriving between the initial fetch and subscription:
// return an empty first snapshot and drop its live creation notification.
const initialSnapshots = new Set<string>();
await page.route("**/api/issues/*/interactions", async (route) => {
const url = route.request().url();
if (route.request().method() === "GET" && !initialSnapshots.has(url)) {
initialSnapshots.add(url);
await route.fulfill({ json: [] });
await page.route(/\/api\/issues\/[^/?]+\/(?:interactions|chat-bootstrap)(?:\?.*)?$/, async (route) => {
const url = new URL(route.request().url());
if (route.request().method() === "GET" && !initialSnapshotReturned) {
initialSnapshotReturned = true;
if (url.pathname.endsWith("/chat-bootstrap")) {
const response = await route.fetch();
const snapshot = await response.json() as Json;
await route.fulfill({ response, json: { ...snapshot, interactions: [] } });
} else await route.fulfill({ json: [] });
} else await route.continue();
});
await page.routeWebSocket("**/api/companies/*/events/ws", (socket) => {
@@ -218,6 +222,7 @@ for (const journey of [
await expect(
page.getByRole("button", { name: "Approve & run", exact: true }),
).toBeVisible({ timeout: 45_000 });
if (journey === "decline") expect(initialSnapshotReturned).toBe(true);
suppressReviewEvents = false;
const originatingReviews = await json<Array<{ id: string; sourceRunId: string | null }>>(await request.get(`/api/issues/${issue.id}/interactions`));
const originatingReview = originatingReviews[0];