chore: sync the frontend template from ebea300 to af3d8e6

Carries 359 template commits, tag v0.2.0 plus one documentation commit: the
generator-built feature index with its app, bounded-context and feature
declarations, the src/platform kernel and scale tooling, the 2026-09-24 src
review fixes, and the 2026-09-25 maturity review round with its CHANGELOG
[보안]/[계약] rows. 691 of the 824 template paths are applied, 85 of them
merged with product changes; 127 are not carried.

Product identity is unchanged: name, version 0.1.0, routes, design and the
TechLog domain.

Three decisions worth naming. TechLog stays composed directly, as the last
two syncs recorded; its directory carries a NOT_INSTALLED marker that says so,
and every installed-* composer takes the template's projection with TechLog
added on top. The reference sample is no longer installed: the template now
installs a feature only through feature-module.ts and context-routes.ts,
which load the screens this product deleted, so its three operations, six
schemas and one topic leave the registries, recorded as registry change
evidence. And AppRouter mounts the platform and TechLog routes only; the
template's bounded-context route gateway waits for a generator-installed
feature.

Required fixes: readSubject on the BFF session owner (without it every HTTP
Studio session would close as integration-failed), zod through the facade in
nine TechLog files, noUnusedLocals, and public/config.json written out to
match the local profile. Derived baselines were recomputed after reproducing
both sides' values: CI contract 101 commands / 106 references / 141
artifacts, gate shape c9adcf85; registry approval 2dc6c3a3; the runtime
config schema baseline equals the schema at 8210d48.

Verified here: types, lint, architecture, adapter inventory, CI contract,
i18n, design system, diagnostics, browser security, dev release manifest,
TechLog contract and build pass; 220 component, 155 integration, 15
contract, 418 TechLog, 43 reference-feature, 18 recipe and 46
release-coherence tests pass, and 2381 of 2383 unit tests. Reproduced at
8210d48 first and unchanged: check:registries (byte-identical),
test:runtime-schema, verify:documentation. Brought by the template and
escalated rather than suppressed: check:request-fanout on TechLog's cursor
pagination, check:remediation-ledger (fails upstream too), the shared-chunk
hash test, and the registry-dependent sample removal and second-feature
tests. Playwright suites were not run.

Full record, the five open questions and the follow-ups in
docs/operations/template-sync-2026-09-29.md.

(cherry picked from commit b2170cf265dea45dc9cc05d3c61e627e97f31cdb)
This commit is contained in:
DongHyeonka
2026-11-12 08:28:54 +09:00
parent 585c62431a
commit c80320dfc7
738 changed files with 55027 additions and 13567 deletions
@@ -329,3 +329,127 @@ test("hands a bounded generated Blob to the real browser download path", async (
},
});
});
/**
* R3-6 / STO-08. The enhanced picker keeps `window.showOpenFilePicker` and
* calls it later. Called with the options object as receiver it would reject
* with "Illegal invocation" (TypeError → UNAVAILABLE). This spec passes the
* real, unbound function and an injected `isActive: true` reading so the app's
* own activation precheck lets the call through; with no real user gesture the
* browser must then reject with its activation error (SecurityError →
* PERMISSION_DENIED). Browsers without the API return UNSUPPORTED, because
* the capability evidence gate forbids skipped cases.
*/
test("calls the real showOpenFilePicker without a receiver and gets the activation error", async ({
page,
}) => {
await page.goto("/");
const result = await page.evaluate(async () => {
const system = (globalThis as typeof globalThis & {
showOpenFilePicker?: (options?: unknown) => Promise<unknown>;
}).showOpenFilePicker;
if (typeof system !== "function") return { kind: "UNSUPPORTED" as const };
// Playwright evaluates with a user gesture, so wait until that transient
// activation expires (5s in Chromium) to get a real "no gesture" call.
const deadline = performance.now() + 10_000;
while (navigator.userActivation.isActive && performance.now() < deadline) {
await new Promise((resolve) => setTimeout(resolve, 100));
}
const activationExpired = !navigator.userActivation.isActive;
const errorName = async (call: () => Promise<unknown>) => {
try {
await call();
return "RESOLVED";
} catch (error) {
return error instanceof Error ? error.name : String(error);
}
};
// Controls: the native activation error, and what a wrong receiver does.
const directWithoutGesture = await errorName(() => system());
const wrongReceiver = await errorName(() =>
Reflect.apply(system, {}, []) as Promise<unknown>,
);
const modulePath = "/src/adapters/browser-files/index.ts";
const { createBrowserFileRuntime, browserFilePolicyReference } =
(await import(
/* @vite-ignore */ modulePath
)) as typeof import("../../src/adapters/browser-files/index.ts");
const input = document.createElement("input");
input.type = "file";
const filePolicy = browserFilePolicyReference("avatar", "enhanced-unbound");
const runtime = createBrowserFileRuntime({
input,
showOpenFilePicker: system as never,
userActivation: { isActive: true },
policies: [
{
reference: filePolicy,
selection: {
policyId: "avatar-v1",
purpose: "avatar",
classification: "PERSONAL",
multiple: false,
maxCount: 1,
maxFileBytes: 1024,
maxTotalBytes: 1024,
allowEmpty: false,
accept: [{ mediaType: "image/png", extensions: [".png"] }],
},
},
],
limits: {
hardMaxPreviewBytes: 1024,
hardMaxObjectUrlBytes: 1024,
hardMaxTransferBytes: 4096,
},
download: {
host: Object.freeze({ handoff() {} }),
browserManagedCapabilities: {
resolve() {
return {
ok: false as const,
error: {
code: "POLICY_REJECTED" as const,
operation: "DOWNLOAD" as const,
retryable: false,
recovery: "NONE" as const,
},
};
},
},
},
});
if (!runtime.enhancedPicker) {
throw new Error("Enhanced picker was not composed.");
}
try {
const selected = await runtime.enhancedPicker.select({
policy: filePolicy,
});
return {
kind: "SUPPORTED" as const,
activationExpired,
directWithoutGesture,
wrongReceiver,
selected,
};
} finally {
runtime.dispose();
}
});
if (result.kind === "UNSUPPORTED") {
expect(result).toEqual({ kind: "UNSUPPORTED" });
return;
}
expect(result.activationExpired).toBe(true);
expect(result.directWithoutGesture).toBe("SecurityError");
expect(result.wrongReceiver).toBe("TypeError");
expect(result.selected).toMatchObject({
ok: false,
error: { code: "PERMISSION_DENIED", operation: "FILE_SELECT" },
});
});
@@ -0,0 +1,29 @@
import { expect, test } from "@playwright/test";
// R3-7. The chunk-recovery classifier matches engine error wording. Run the
// app's own classifier (served by the dev server) against the error each real
// engine reports for a dynamic import whose chunk is gone after a deploy, so a
// wording change in Chromium, Firefox or WebKit fails here.
test("classifies the engine's missing dynamic-import chunk error as a chunk failure", async ({
page,
}) => {
await page.goto("/");
const result = await page.evaluate(async () => {
// A browser URL served by the dev server, not a module tsc resolves.
const classifierUrl = "/src/presentation/boundaries/chunk-recovery-boundary.tsx";
const { isChunkLoadFailure } = (await import(classifierUrl)) as {
isChunkLoadFailure: (error: unknown) => boolean;
};
try {
await import(`/assets/removed-after-deploy-${Date.now()}.js`);
return { reported: "no error", classified: false };
} catch (error) {
return {
reported: error instanceof Error ? `${error.name}: ${error.message}` : String(error),
classified: isChunkLoadFailure(error),
};
}
});
expect(result.classified, result.reported).toBe(true);
});
@@ -23,12 +23,14 @@ async function startLifecycleRuntime(
name: string,
targetVersion: 1 | 2,
blockedTimeoutMs = 1_000,
partitioned = false,
): Promise<void> {
await page.evaluate(
async ({
currentDatabaseName,
currentTargetVersion,
currentBlockedTimeoutMs,
currentPartitioned,
}) => {
const modulePath =
"/src/adapters/storage/indexeddb/indexeddb-runtime.ts";
@@ -38,24 +40,31 @@ async function startLifecycleRuntime(
type LifecycleValue = Readonly<{ value: string }>;
const [authorityToken, namespaceToken, partitionToken] =
currentDatabaseName.slice("ca-idb-v1:".length).split(".");
const accountScope = currentPartitioned
? ("OPAQUE_PARTITION" as const)
: ("ORIGIN_SHARED" as const);
const scope = {
authorityToken,
namespaceToken,
partitionToken,
accountScope: "ORIGIN_SHARED" as const,
accountScope,
};
const storagePolicy = {
owner: "platform-storage",
namespace: "indexeddb-browser-lifecycle",
classification: "INTERNAL" as const,
authority: "SERVER" as const,
accountScope: "ORIGIN_SHARED" as const,
accountScope,
retention: { kind: "EXPLICIT_DELETE" as const },
softBudgetBytes: 1_000_000,
hardBudgetBytes: 2_000_000,
evictionPriority: "SYNCED_COPY" as const,
logoutAction: "KEEP_ORIGIN_SHARED" as const,
accountDeletionAction: "KEEP_ORIGIN_SHARED" as const,
logoutAction: currentPartitioned
? ("PURGE_PARTITION" as const)
: ("KEEP_ORIGIN_SHARED" as const),
accountDeletionAction: currentPartitioned
? ("PURGE_PARTITION" as const)
: ("KEEP_ORIGIN_SHARED" as const),
pressureAction: "RETAIN" as const,
unavailableFallback: "ONLINE_ONLY" as const,
};
@@ -184,6 +193,7 @@ async function startLifecycleRuntime(
currentDatabaseName: name,
currentTargetVersion: targetVersion,
currentBlockedTimeoutMs: blockedTimeoutMs,
currentPartitioned: partitioned,
},
);
}
@@ -1067,3 +1077,155 @@ test("fails a blocked v2 upgrade closed, then closes its late connection after t
await blockerPage.close();
}
});
test("05-03 deletes a partition's dataset for an authorized ACCOUNT_DELETION when its budget row is corrupt", async ({
page,
}) => {
const name = databaseName("corrupt-governance");
await page.goto("/");
await startLifecycleRuntime(page, name, 1, 1_000, true);
expect(await settleLifecycleRuntime(page)).toMatchObject({
opened: { ok: true },
});
expect(
await page.evaluate(async () => {
const runtime = (
globalThis as unknown as {
__indexedDbLifecycleRuntime: {
compareAndSwap(input: unknown): Promise<unknown>;
close(): void;
};
}
).__indexedDbLifecycleRuntime;
const written = await runtime.compareAndSwap({
key: "personal-1",
value: { value: "mine" },
expectedRevision: null,
idempotencyKey: "personal-create",
});
runtime.close();
return written;
}),
).toMatchObject({ ok: true });
expect(
await page.evaluate(
async (currentDatabaseName) =>
await new Promise<string>((resolve) => {
const request = indexedDB.open(currentDatabaseName, 1);
request.onerror = () =>
resolve(request.error?.name ?? "UNKNOWN_ERROR");
request.onsuccess = () => {
const database = request.result;
const transaction = database.transaction(
"governance",
"readwrite",
);
transaction.objectStore("governance").put({
bindingKey: "dataset-budget",
budgetVersion: 1,
usedBytes: -5,
receiptCount: 1,
});
transaction.oncomplete = () => {
database.close();
resolve("CORRUPTED");
};
transaction.onabort = () => {
database.close();
resolve("ABORTED");
};
};
}),
name,
),
).toBe("CORRUPTED");
await startLifecycleRuntime(page, name, 1, 1_000, true);
expect(await settleLifecycleRuntime(page)).toMatchObject({
opened: { ok: false, error: { code: "POLICY_REJECTED" } },
});
const purged = await page.evaluate(async () => {
const runtime = (
globalThis as unknown as {
__indexedDbLifecycleRuntime: {
enforceLifecycleBatch(input: unknown): Promise<unknown>;
};
}
).__indexedDbLifecycleRuntime;
return await runtime.enforceLifecycleBatch({
action: "ACCOUNT_DELETION",
maxRows: 100,
maxDurationMs: 5_000,
});
});
expect(purged).toMatchObject({
ok: true,
value: { state: "COMPLETE", datasetDeleted: true },
});
const remaining = await page.evaluate(async (currentDatabaseName) => {
(
globalThis as unknown as {
__indexedDbLifecycleRuntime?: { close(): void };
}
).__indexedDbLifecycleRuntime?.close();
// A fresh open of a deleted database runs its upgrade from version 0.
return await new Promise<number>((resolve, reject) => {
const request = indexedDB.open(currentDatabaseName);
let oldVersion = -1;
request.onupgradeneeded = (event) => {
oldVersion = event.oldVersion;
};
request.onsuccess = () => {
request.result.close();
const deletion = indexedDB.deleteDatabase(currentDatabaseName);
deletion.onsuccess = () => resolve(oldVersion);
deletion.onerror = () => reject(deletion.error);
};
request.onerror = () => reject(request.error);
});
}, name);
expect(remaining).toBe(0);
});
test("05-06 an older tab meets a schema a newer tab upgraded and goes online-only", async ({
page,
}) => {
const olderPage = await page.context().newPage();
const name = databaseName("future-schema");
try {
await Promise.all([page.goto("/"), olderPage.goto("/")]);
expect(await installLifecycleRuntime(page, name, 2)).toMatchObject({
opened: { ok: true },
status: { kind: "READY", schemaVersion: 2 },
});
await closeLifecycleRuntime(page);
expect(await installLifecycleRuntime(olderPage, name, 1)).toEqual({
opened: {
ok: false,
error: {
code: "UNSUPPORTED",
operation: "INDEXEDDB_OPEN",
retryable: false,
recovery: "ONLINE_ONLY",
},
},
status: { kind: "INCOMPATIBLE", schemaVersion: 1 },
});
await closeLifecycleRuntime(olderPage);
const deletion = await page.evaluate(
async (currentDatabaseName) =>
await new Promise<string>((resolve) => {
const request = indexedDB.deleteDatabase(currentDatabaseName);
request.onsuccess = () => resolve("DELETED");
request.onerror = () =>
resolve(request.error?.name ?? "UNKNOWN_ERROR");
request.onblocked = () => resolve("BLOCKED");
}),
name,
);
expect(deletion).toBe("DELETED");
} finally {
await olderPage.close();
}
});
@@ -219,3 +219,193 @@ test("runs put, open, remove and reconcile through a native DedicatedWorker, OPF
expect(result.deletion).toBe("DELETED");
expect(["DELETED", "ABSENT"]).toContain(result.opfsCleanup);
});
type OpfsTabScope = Readonly<{
namespace: string;
authorityToken: string;
namespaceToken: string;
partitionToken: string;
}>;
/**
* Installs an OPFS runtime for `scope` in this tab and keeps it on
* `globalThis.__opfsTab` for later evaluate calls.
*/
async function installOpfsTab(
page: import("@playwright/test").Page,
scope: OpfsTabScope,
): Promise<boolean> {
return await page.evaluate(async (tabScope) => {
const runtimeModulePath =
"/src/adapters/storage/opfs/browser-opfs-runtime.ts";
const policyModulePath = "/src/adapters/storage/opfs/opfs-policy.ts";
const { createBrowserOpfsRuntime, inspectBrowserOpfsSupport } =
(await import(
/* @vite-ignore */ runtimeModulePath
)) as typeof import("../../src/adapters/storage/opfs/browser-opfs-runtime.ts");
const { resolveOpfsRuntimePolicy } = (await import(
/* @vite-ignore */ policyModulePath
)) as typeof import("../../src/adapters/storage/opfs/opfs-policy.ts");
const policy = resolveOpfsRuntimePolicy();
if (!inspectBrowserOpfsSupport(policy).ok) return false;
(globalThis as unknown as { __opfsTab: unknown }).__opfsTab =
createBrowserOpfsRuntime({
workerUrl: new URL(
"/tests/browser-capabilities/opfs-test.worker.ts",
location.href,
),
workerName: `opfs-tab-${crypto.randomUUID()}`,
scope: tabScope,
storagePolicy: {
owner: "browser-capability",
namespace: tabScope.namespace,
classification: "PERSONAL",
authority: "LOCAL_FIRST",
accountScope: "OPAQUE_PARTITION",
retention: { kind: "EXPLICIT_DELETE" },
softBudgetBytes: 1024 * 1024,
hardBudgetBytes: 2 * 1024 * 1024,
evictionPriority: "USER_AUTHORED",
logoutAction: "EXPORT_THEN_PURGE",
accountDeletionAction: "PURGE_PARTITION",
pressureAction: "RETAIN",
unavailableFallback: "EXPORT_REQUIRED",
},
policy,
});
return true;
}, scope);
}
test("05-01 a reconcile in another tab skips a live put and the put stays readable", async ({
page,
}) => {
const secondPage = await page.context().newPage();
const suffix = crypto.randomUUID().replaceAll("-", "");
const scope: OpfsTabScope = {
namespace: "durable-objects",
authorityToken: `authority_${suffix}`,
namespaceToken: `namespace_${suffix}`,
partitionToken: `partition_${suffix}`,
};
type Tab = import("../../src/adapters/storage/opfs/browser-opfs-runtime.ts").BrowserOpfsRuntime;
try {
await Promise.all([page.goto("/"), secondPage.goto("/")]);
if (!(await installOpfsTab(page, scope))) return;
expect(await installOpfsTab(secondPage, scope)).toBe(true);
// Tab A starts a put whose source stalls, so its journal row stays
// PREPARING and its worker holds the OPFS mutation lock.
await page.evaluate(async () => {
const state = globalThis as unknown as {
__opfsTab: Tab;
__release?: () => void;
__put?: Promise<unknown>;
};
let streaming!: () => void;
const started = new Promise<void>((resolve) => {
streaming = resolve;
});
const gate = new Promise<void>((resolve) => {
state.__release = resolve;
});
state.__put = state.__opfsTab.objects.put({
objectId: "object_tab_12345678",
expectedGeneration: null,
mediaType: "application/octet-stream",
source: {
byteLength: 4,
async *stream() {
streaming();
await gate;
yield { ok: true as const, value: new Uint8Array([2, 7, 1, 8]) };
},
},
});
await started;
});
// Tab B reconciles while tab A's put is in flight.
await secondPage.evaluate(() => {
const state = globalThis as unknown as {
__opfsTab: Tab;
__reconcile?: Promise<unknown>;
};
state.__reconcile = state.__opfsTab.maintenance.reconcile();
});
await page.waitForTimeout(250);
const put = await page.evaluate(async () => {
const state = globalThis as unknown as {
__release: () => void;
__put: Promise<unknown>;
};
state.__release();
return await state.__put;
});
const reconciled = await secondPage.evaluate(
async () =>
await (globalThis as unknown as { __reconcile: Promise<unknown> })
.__reconcile,
);
const opened = await page.evaluate(async () => {
const runtime = (globalThis as unknown as { __opfsTab: Tab }).__opfsTab;
const result = await runtime.objects.open({
objectId: "object_tab_12345678",
});
if (!result.ok) return result.error.code;
const bytes: number[] = [];
for await (const chunk of result.value.source.stream(
new AbortController().signal,
)) {
if (!chunk.ok) return chunk.error.code;
bytes.push(...chunk.value);
}
return bytes;
});
expect(put).toMatchObject({ ok: true, value: { generation: 1 } });
expect(reconciled).toMatchObject({
ok: true,
value: { skippedLiveTransactions: 1, rolledBackTransactions: 0 },
});
expect(opened).toEqual([2, 7, 1, 8]);
} finally {
for (const tab of [page, secondPage]) {
await tab.evaluate(() =>
(globalThis as unknown as { __opfsTab?: Tab }).__opfsTab?.close(),
);
}
const cleanup = await page.evaluate(async (tabScope) => {
const journalModulePath =
"/src/adapters/storage/opfs/indexeddb-opfs-journal.ts";
const policyModulePath = "/src/adapters/storage/opfs/opfs-policy.ts";
const { opfsJournalDatabaseName } = (await import(
/* @vite-ignore */ journalModulePath
)) as typeof import("../../src/adapters/storage/opfs/indexeddb-opfs-journal.ts");
const { DEFAULT_OPFS_RUNTIME_POLICY } = (await import(
/* @vite-ignore */ policyModulePath
)) as typeof import("../../src/adapters/storage/opfs/opfs-policy.ts");
const deletion = await new Promise<string>((resolve) => {
const request = indexedDB.deleteDatabase(
opfsJournalDatabaseName(tabScope.authorityToken),
);
request.onsuccess = () => resolve("DELETED");
request.onerror = () => resolve(request.error?.name ?? "UNKNOWN");
request.onblocked = () => resolve("BLOCKED");
});
try {
const root = await (
await navigator.storage.getDirectory()
).getDirectoryHandle(DEFAULT_OPFS_RUNTIME_POLICY.rootDirectoryName);
await (
await root.getDirectoryHandle("authorities")
).removeEntry(tabScope.authorityToken, { recursive: true });
} catch {
// Nothing was written for this authority.
}
return deletion;
}, scope);
expect(cleanup).toBe("DELETED");
await secondPage.close();
}
});
@@ -310,3 +310,142 @@ test("keeps A active across a failed B stage, activates B with A rollback, and c
expect(result.rollbackAPreserved).toBe(true);
expect(result.remainingOwnedCount).toBe(3);
});
/**
* R3-6. The real Cache API applies `Vary` on `match()`, which the in-memory
* fakes do not. A public asset served with `Vary: Accept-Encoding` must stage,
* activate and still be found by the exact lookup.
*/
test("stages, activates, and looks up a Vary: Accept-Encoding response in the real Cache API", async ({
page,
}) => {
await page.goto("/");
const result = await page.evaluate(async () => {
const adapterModulePath =
"/src/adapters/cache-storage/public-response-cache-adapter.ts";
const policyModulePath =
"/src/adapters/cache-storage/public-cache-policy.ts";
const {
computePublicCacheManifestDigestHex,
createPublicCacheWebLock,
createPublicResponseCacheAdapter,
} = (await import(
/* @vite-ignore */ adapterModulePath
)) as typeof import("../../src/adapters/cache-storage/public-response-cache-adapter.ts");
const { createDefaultPublicCachePolicy } = (await import(
/* @vite-ignore */ policyModulePath
)) as typeof import("../../src/adapters/cache-storage/public-cache-policy.ts");
const suffix = crypto.randomUUID().replaceAll("-", "");
const releaseId = `browser-vary-${suffix.slice(0, 20)}`;
const policy = {
...createDefaultPublicCachePolicy(location.origin),
ownedCachePrefix: `cap-${suffix.slice(0, 24)}:`,
mutationLockName: `cap-${suffix}:mutation`,
};
const url = `${location.origin}/cache-${suffix}-vary.js`;
const bytes = new TextEncoder().encode("export const vary = 1;");
const digest = await crypto.subtle.digest("SHA-256", bytes);
const assets = [
{
absoluteUrl: url,
expectedByteLength: bytes.byteLength,
expectedContentType: "application/javascript",
integrity: {
algorithm: "SHA-256" as const,
digestHex: Array.from(new Uint8Array(digest), (byte) =>
byte.toString(16).padStart(2, "0"),
).join(""),
},
},
];
const manifest = {
releaseRegistryId: releaseId,
assets,
manifestDigestHex: await computePublicCacheManifestDigestHex(
crypto,
releaseId,
assets,
policy,
),
};
const adapter = createPublicResponseCacheAdapter({
cacheStorage: caches,
crypto,
mutationLock: createPublicCacheWebLock(
navigator.locks,
policy.mutationLockName,
),
policy,
fetcher: async (request) => {
if (request.url !== url) throw new TypeError("Unexpected cache URL.");
return new Response(Uint8Array.from(bytes), {
status: 200,
headers: {
"cache-control": "public, max-age=31536000, immutable",
"content-type": "application/javascript",
vary: "Accept-Encoding",
},
});
},
});
try {
const staged = await adapter.admin.stageRelease(manifest);
const activated = await adapter.admin.activateRelease(
manifest.releaseRegistryId,
manifest.manifestDigestHex,
);
const matched = await adapter.responses.matchActiveExact({
absoluteUrl: url,
});
const streamed: number[] = [];
if (matched.ok && matched.value) {
for await (const chunk of matched.value.body.stream(
new AbortController().signal,
)) {
if (!chunk.ok) return { staged, activated, matched: chunk };
streamed.push(...chunk.value);
}
}
// What the browser itself stored, read back through the raw Cache API.
const releaseCacheName = (await caches.keys()).find((name) =>
name.startsWith(`${policy.ownedCachePrefix}release:${releaseId}:`),
);
const raw = releaseCacheName
? await (await caches.open(releaseCacheName)).match(url)
: undefined;
return {
staged,
activated,
matched: matched.ok
? {
ok: true,
found: matched.value !== null,
vary:
matched.value?.headers.find(
([name]) => name.toLowerCase() === "vary",
)?.[1] ?? null,
}
: matched,
streamed,
rawVary: raw?.headers.get("vary") ?? null,
expected: Array.from(bytes),
};
} finally {
for (const name of await caches.keys()) {
if (name.startsWith(policy.ownedCachePrefix)) await caches.delete(name);
}
}
});
expect(result.staged).toMatchObject({ ok: true, value: { entryCount: 1 } });
expect(result.activated).toMatchObject({ ok: true });
expect(result.matched).toEqual({
ok: true,
found: true,
vary: "Accept-Encoding",
});
expect(result.streamed).toEqual(result.expected);
expect(result.rawVary).toBe("Accept-Encoding");
});