Fix queue list not updating: restore fast polling alongside events

The previous change extended the poll from 5s to 30s relying on
photo-updated events, but the service worker may still serve the old
storage.js without event dispatch, leaving the list stale.

Now polls every 3s while there are active uploads (pending/uploading),
15s fallback when idle, plus event-based refresh as a bonus.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 16:13:38 -06:00
parent 3f0b0ea2e2
commit 4e6fec43d3
2 changed files with 19 additions and 10 deletions

View File

@@ -1,9 +1,9 @@
// NextSnap Service Worker
// Provides offline-first caching for the app shell
const CACHE_VERSION = 'nextsnap-v16';
const APP_SHELL_CACHE = 'nextsnap-shell-v12';
const RUNTIME_CACHE = 'nextsnap-runtime-v12';
const CACHE_VERSION = 'nextsnap-v17';
const APP_SHELL_CACHE = 'nextsnap-shell-v13';
const RUNTIME_CACHE = 'nextsnap-runtime-v13';
// Assets to cache on install
const APP_SHELL_ASSETS = [