A write refused because it arrived past its declared deadline is final: waiting or re-sending only arrives later still. The pinned alpha never emits the code, so the entry is inert until a store does.
- commit
- 15339c579900e81fe280667ef5dd89b99f2088a0
- parent
- 3efb3159ec58cb56fca6e91edf3dfad211f523d9
- author
- Dami <dami.etoile@gmail.com>
| M | src/ | 6 | ++++++ |
| M | tests/ | 9 | ++++++++- |
@@ -28,9 +28,15 @@ export type MutationErrorClass = "permanent" | "transient";
2828 * this session). Writes that violate the CURRENT locally-known policy or2929 * schema never produce a code at all — the client runtime refuses them3030 * synchronously at the call site, before any batch exists.31+ *32+ * `expired` (the store refused the write because it arrived past its declared33+ * deadline) is registered permanent: late arrival is final, since waiting or34+ * re-sending only arrives later still. The pinned alpha never emits it, so35+ * the entry is inert until a store does.3136 */3237 export const MUTATION_ERROR_CLASSES: Readonly<Record<string, MutationErrorClass>> = {3338 permission_denied: "permanent",39+ expired: "permanent",3440 };3541 3642 /**@@ -14,8 +14,15 @@ Deno.test("verdict: permission_denied is permanent", () => {
1414 assert(isPermanentMutationError("permission_denied"));1515 });1616 17+Deno.test("verdict: expired is permanent", () => {18+ assertEquals(classifyMutationError("expired"), "permanent");19+ assert(isPermanentMutationError("expired"));20+});21+1722 Deno.test("verdict: unknown codes classify transient", () => {18- for (const code of ["", "store_unreachable", "some_future_code", "PERMISSION_DENIED"]) {23+ for (24+ const code of ["", "store_unreachable", "some_future_code", "PERMISSION_DENIED", "EXPIRED"]25+ ) {1926 assertEquals(classifyMutationError(code), "transient", `code ${JSON.stringify(code)}`);2027 assertEquals(isPermanentMutationError(code), false);2128 }