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:
hsiegeln
2026-04-18 22:14:38 +02:00
parent 2289547503
commit 830c740747
5 changed files with 21 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
export type CacheStrategy = 'shell' | 'swr' | 'images' | 'network-only';
export type RequestShape = { url: string; method: string };
type RequestShape = { url: string; method: string };
// Pure function — sole decision-maker for "which strategy for this request?".
// Called by the service worker for every fetch event.