refactor(constants): zentrale SW-Timing-Konstanten + minor cleanups
- 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
This commit is contained in:
11
src/lib/constants.ts
Normal file
11
src/lib/constants.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// 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;
|
||||
Reference in New Issue
Block a user