fix(news): persist publication requests and retry cache delivery
CI / check (push) Successful in 3m12s
CI / deploy (push) Successful in 1m13s
CI / publish-container (push) Successful in 42s

This commit is contained in:
Simo committed 2026-09-13 18:33:45 +02:00
1 parent c977fe95ba
commit 52f6d1491f
40 files changed
+733 -134

No files matched your search

+14 -1
View File
@@ -18,7 +18,11 @@ vi.mock("@/lib/cache", () => ({
},
}));
import { cacheNews, invalidateNewsCache } from "./news-cache";
import {
cacheNews,
invalidateNewsCache,
refreshNewsCacheForDelivery,
} from "./news-cache";
beforeEach(() => {
state.values.clear();
@@ -65,3 +69,12 @@ it("reads fresh data when Redis is unavailable", async () => {
"fresh",
]);
});
it("keeps failed durable cache invalidations retryable", async () => {
state.set.mockRejectedValue(Error("offline"));
await expect(refreshNewsCacheForDelivery()).rejects.toThrow("offline");
});
it("does not acknowledge an ended Redis connection as refreshed", async () => {
state.status = "end";
await expect(refreshNewsCacheForDelivery()).rejects.toThrow();
});