H-391: preserve unknown cache state

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-08-21 13:31:54 +08:00
co-authored by multica-agent
parent 1555ce5705
commit 6161f299d5
4 changed files with 99 additions and 87 deletions
+9
View File
@@ -32,6 +32,15 @@ test("export policy redacts credentials and bounds bodies", () => {
assert(!shouldRetryStartup(undefined));
});
test("cache state stays unknown without a preceding request event", () => {
const collector = eventCollector("session-a", "target-a");
collector.listener("Network.responseReceived", {
requestId: "orphan-response",
response: { url: "https://example.test/favicon.ico", status: 200, protocol: "h2", mimeType: "image/x-icon", headers: {} },
});
assert.deepEqual(collector.records[0].response.cache, { state: "unknown" });
});
test("WebSocket limits aggregate drops without payloads", () => {
const collector = eventCollector("session-a", "target-a", {
maxWebSocketFrameBytes: 4,