Problem
stablePreviewUrls in useWorkspace.ts caches the first presigned URL per slide to prevent unnecessary image re-downloads during polling. However, this cache is only cleared on:
- Deck switch (new
activeDeckId)
pptxRequested trigger
If a user keeps a deck open for an extended period without triggering either condition, the cached presigned URLs will expire (S3 default is typically 15 min to 1 hour). After expiry, <img> elements will show broken images since the cached URLs are no longer valid.
Suggested Fix
Options (pick one):
- TTL-based cache eviction - Store timestamp alongside URL, clear entries older than N minutes
<img onError> retry - On image load failure, evict the cached URL for that slideId and trigger a re-fetch
- Periodic cache clear - Clear
stablePreviewUrls every N minutes regardless of user action
Option 2 is probably the lightest touch since it only triggers on actual failure.
Context
Introduced in PR #15 (fix/preview-polling-redownload). The URL stabilisation cache is correct for its intended purpose; this issue tracks the edge case of long-lived sessions.
Files
web-ui/src/hooks/useWorkspace.ts - stablePreviewUrls ref
Problem
stablePreviewUrlsinuseWorkspace.tscaches the first presigned URL per slide to prevent unnecessary image re-downloads during polling. However, this cache is only cleared on:activeDeckId)pptxRequestedtriggerIf a user keeps a deck open for an extended period without triggering either condition, the cached presigned URLs will expire (S3 default is typically 15 min to 1 hour). After expiry,
<img>elements will show broken images since the cached URLs are no longer valid.Suggested Fix
Options (pick one):
<img onError>retry - On image load failure, evict the cached URL for that slideId and trigger a re-fetchstablePreviewUrlsevery N minutes regardless of user actionOption 2 is probably the lightest touch since it only triggers on actual failure.
Context
Introduced in PR #15 (fix/preview-polling-redownload). The URL stabilisation cache is correct for its intended purpose; this issue tracks the edge case of long-lived sessions.
Files
web-ui/src/hooks/useWorkspace.ts-stablePreviewUrlsref