Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion e2e/start-rebundle-gate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ try {
await sleep(1500);
const bundledAfter = log.split("client bundled").length;
if (bundledAfter !== bundledBefore) {
throw new Error(`README edit rebundled the client (${bundledAfter - bundledBefore} run(s)); log tail:\n${log.slice(-3000)}`);
throw new Error(
`README edit rebundled the client (${bundledAfter - bundledBefore} run(s)); log tail:\n${log.slice(-3000)}`,
);
}
console.log("gate: README edit skipped the rebundle and the reload");

Expand Down
18 changes: 14 additions & 4 deletions e2e/unit/cf-environment-api.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ test("a source edit sends a targeted update to the accept boundary; dead ends st
headers: { "content-type": "application/json" },
body: JSON.stringify({ paths: [path.join(fx.root, rel)] }),
});
assert.equal(res.status, 204);
// Change invalidations answer 200 with a matched count (resyncs keep 204).
assert.equal(res.status, 200);
const { matched } = await res.json();
assert.ok(matched === null || typeof matched === "number", `matched count in the reply, got ${matched}`);
};
const probe = async () => (await fetch(`http://127.0.0.1:${port}/__probe`)).json();

Expand Down Expand Up @@ -495,7 +498,10 @@ test("create retries failed resolutions, delete prunes, legacy hooks and hook er
headers: { "content-type": "application/json" },
body: JSON.stringify({ changes: [{ path: path.join(fx.root, rel), type }] }),
});
assert.equal(res.status, 204);
// Change invalidations answer 200 with a matched count (resyncs keep 204).
assert.equal(res.status, 200);
const { matched } = await res.json();
assert.ok(matched === null || typeof matched === "number", `matched count in the reply, got ${matched}`);
};
const probe = async () => (await fetch(`http://127.0.0.1:${port}/__probe`)).json();

Expand Down Expand Up @@ -633,7 +639,11 @@ test("invalidate dedup: content identity, atomic-save create, read errors", asyn
headers: { "content-type": "application/json" },
body: JSON.stringify({ changes: [{ path: p, type }] }),
});
assert.equal(res.status, 204);
// Change invalidations answer 200 with a matched count (resyncs keep
// 204); a deduped repeat send may legitimately report 0.
assert.equal(res.status, 200);
const { matched } = await res.json();
assert.ok(matched === null || typeof matched === "number", `matched count in the reply, got ${matched}`);
};
const probe = async () => (await fetch(`http://127.0.0.1:${port}/__probe`)).json();

Expand Down Expand Up @@ -962,7 +972,7 @@ test("resync acks on enqueue and duplicates coalesce behind a slow invalidate qu
assert.equal(r2.status, 204);
assert.ok(Date.now() - t0 < 500, `resync ACKs on enqueue, took ${Date.now() - t0}ms behind a 700ms queue`);

assert.equal((await slow).status, 204, "the change invalidation still answers on completion");
assert.equal((await slow).status, 200, "the change invalidation still answers on completion");
await new Promise((r) => setTimeout(r, 300));
const seen = await (await fetch(`http://127.0.0.1:${port}/__probe`)).json();
const reloads = seen.workerSends.filter((p) => p.type === "full-reload");
Expand Down
6 changes: 5 additions & 1 deletion e2e/unit/invalidate-canonical.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ test("a change spelled through a symlink invalidates the canonically keyed modul
headers: { "content-type": "application/json" },
body: JSON.stringify({ paths: [watched] }),
});
assert.equal(res.status, 204);
// A change invalidation answers 200 with how many changes matched a
// runner-backed graph; the symlink spelling resolves to the one
// canonically keyed module.
assert.equal(res.status, 200);
assert.deepEqual(await res.json(), { matched: 1 });

const seen = await (await fetch(`http://127.0.0.1:${port}/__probe`)).json();
assert.ok(
Expand Down
Loading