fix(storage): preserve claims across kv fallback

Only missing tables justify KV fallback; other failures must surface.
Remember fallback writes so migration to D1 cannot forget claims
and replay completed work. Share marker checks without extra writes.
This commit is contained in:
翅膀 committed 2026-10-23 23:21:17 +08:00
1 parent 4d5c5e412d
commit 50966a4c50
3 files changed
+289 -13

No files matched your search

+3 -2
View File
@@ -22,8 +22,9 @@ describe("deliveryKey", () => {
expect(deliveryKey("github", "team-a", "deliv-1")).toBe("delivery:github:team-a:deliv-1");
});
it("falls back to 'global' without a tenant", () => {
expect(deliveryKey("github", undefined, "deliv-1")).toBe("delivery:github:global:deliv-1");
it("uses a scope no group id can take without a tenant", () => {
expect(deliveryKey("github", undefined, "deliv-1")).toBe("delivery:github:@global:deliv-1");
expect(deliveryKey("github", "global", "deliv-1")).toBe("delivery:github:global:deliv-1");
});
});