mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
Stream tokens are stored in-memory and lost on restart. The frontend cached the old token for up to 50 minutes (staleTime) and never refetched, so all thumbnail/stream requests failed with 401 until a manual page reload. Added a global error listener in useStreamTokenSync that detects when img/video elements fail to load with the current stream token and automatically invalidates the camera-stream-token query to fetch a fresh one. Debounced with a 5s cooldown to avoid spamming when many images fail at once.