Version 4.3.0 — Stability & Caching Layer
Release Date: 2025-02-20
Focus: React Query caching, REST spike prevention, documentation alignment
🔥 Summary
This release introduces a stability-focused layer on top of the existing Performance Optimization Edition.
The goal is to make data loading predictable and efficient by standardizing React Query caching rules, eliminating low-interval polling, and formalizing "no REST on hover / animation" as a core principle.
✨ Added / Changed
1. React Query Caching Rules
- Global Defaults (QueryClient):
staleTime: 30_000ms (30 seconds) — data is considered fresh for dashboards and mapsgcTime: 60_000ms (60 seconds) — cache is retained for quick back/forward navigationrefetchOnWindowFocus: false— no hidden refetch bursts when users switch browser tabsrefetchOnReconnect: false— avoids reconnect storms on flaky networksrefetchOnMount: false— no re-fetch on mount while data is still freshretry: 1with exponential backoff for transient Supabase issues
- Per-hook Overrides:
- Critical flows (e.g. live dashboards) can opt-in to shorter
staleTime(5–10s), but must do so explicitly.
- Critical flows (e.g. live dashboards) can opt-in to shorter
2. REST Spike Prevention
- No Low-Interval Polling:
- Removed legacy 5-second polling for driver shipments in the Driver Dashboard.
- Shipment lists now rely on:
- Initial snapshot fetch
- Supabase Realtime channel (per-driver
shipmentsstream)
- No REST on Hover / Animation:
- Confirmed and documented that:
FloorplanViewer(Lagerkarte) does not issue Supabase requests inonMouseMove, hover handlers, or panning/zoom.- Simulation hooks (
useFloorplanSimulation,useWarehouseSimulation) are purely in-memory:- All ticks operate on local state derived from initial snapshots.
- No Supabase / HTTP calls are made from simulation tick loops.
- Confirmed and documented that:
- Event-Driven Fetching Only:
- Data-loading logic is tied to:
- Explicit toggles (e.g. enabling overlays)
- Route / floorplan selection
- Realtime events and targeted React Query invalidations
- No fetches are triggered directly from render cycles.
- Data-loading logic is tied to:
3. Stability Layer Principles (Documented)
- New documentation sections describe the stability layer:
- Snapshot-first: Prefer
get-dashboard-snapshot-v2and other aggregated endpoints for dashboard views. - Cache-first: Use React Query caches and IndexedDB before hitting Supabase again.
- Realtime over Polling: Use Supabase Realtime for high-frequency updates, with polling only as a slow fallback.
- No REST on Hover / Animation: Hover and animation code paths must never trigger network calls.
- Simulation is Local: All movement / visualization simulations operate on local state.
- Snapshot-first: Prefer
4. Documentation Alignment
- Updated VitePress documentation to match the current stability layer:
- Architecture Guide: Clarified multi-layer caching and React Query defaults (30s / 60s).
- Performance Optimization Guide: Documented the stability rules, React Query configuration, and realtime strategy.
- Changelog: Added v4.3.0 entry and updated version history to include the 4.x series.
🧩 Compatibility & Scope
- Additive Only:
- No schema changes.
- No business logic changes to inventory, safety, or workflows.
- No UI layout or theme changes.
- Focus:
- Stability, caching, and REST behavior only.
🚀 Migration Notes
React Query Defaults
- If you previously relied on
refetchOnWindowFocusbehavior, switch to:- Explicit
queryClient.invalidateQueries(...)on relevant actions, or - Per-hook overrides (
refetchOnWindowFocus: true) where truly required.
- Explicit
- If you previously relied on
Polling
- Do not re-introduce high-frequency polling (
< 30s) for any view. - If realtime is unavailable, prefer:
- Snapshot-based reload buttons, or
- Low-frequency polling (30–60s) with clear comments.
- Do not re-introduce high-frequency polling (
New Development
- When adding new modules:
- Reuse existing React Query client and key factories.
- Follow the stability layer principles described in the Performance guide.
- When adding new modules: