- src/lib/constants.ts: SW_VERSION_QUERY_TIMEOUT_MS, SW_UPDATE_POLL_INTERVAL_MS - pwa.svelte.ts: nutzt die Konstanten statt 1500/30*60_000 - cache-strategy.ts / diff-manifest.ts: RequestShape/ManifestDiff entkapselt (intern statt export, da nirgends extern importiert) - recipes/[id]/image: deutsche Fehlermeldungen auf Englisch (Konsistenz mit allen anderen Endpoints) Findings aus REVIEW-2026-04-18.md (Quick-Wins 6+7) und dead-code.md
12 lines
579 B
TypeScript
12 lines
579 B
TypeScript
// Shared timing constants. Keep magic numbers here so callers stay readable
|
|
// and the rationale lives next to the value.
|
|
|
|
// How long to wait for a Service Worker to answer GET_VERSION before
|
|
// treating the response as missing. Short on purpose — SWs that take this
|
|
// long are likely the Chromium zombie case (see pwa.svelte.ts).
|
|
export const SW_VERSION_QUERY_TIMEOUT_MS = 1500;
|
|
|
|
// Active update check while the page sits open in a tab. 30 minutes is a
|
|
// trade-off between being timely and not hammering the server.
|
|
export const SW_UPDATE_POLL_INTERVAL_MS = 30 * 60_000;
|