The sync engine was adding per-photo backoff delays (2-60s) inside
the processing loop, during which the user would navigate to another
page (browser -> queue -> browser), killing the sync mid-wait. The
upload POST never fired because the delay ran out the clock.
Changes:
- Remove per-photo backoff delay from processQueue loop — uploads
start immediately on page load without blocking
- Move retry scheduling to after the full queue pass: if any uploads
failed, schedule a new triggerSync() after 15s instead of blocking
inline
- Keep the duplicate check on retries (fast, catches interrupted
uploads that actually succeeded server-side)
- uploadPhoto now returns true/false so processQueue can track
failures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
iOS Safari kills fetch requests when the app goes to background or
the connection drops during large uploads, producing 'load failed'.
The sync engine was burning through all 5 retries instantly with no
delay, so a transient failure became permanent.
Changes:
- Add AbortController timeout (120s) on upload fetch
- Add exponential backoff between retries (2s, 5s, 10s...60s)
- Increase max retries from 5 to 15 for flaky mobile networks
- Remove 10MB resize step that was re-compressing photos already
sized at capture time, avoiding extra memory pressure on iOS
- Log photo size with each upload attempt for easier debugging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After renaming a file, loadDirectory() was called which rebuilt the
galleryImages array in new alphabetical order. The gallery index
didn't change, so it now pointed to a different file — subsequent
renames hit the wrong file.
Fix: only update local state during the gallery session, defer the
file list refresh to when the gallery closes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Offline-first photo capture app for Nextcloud with:
- Camera capture with continuous mode (auto-reopens after each photo)
- File browser with fullscreen image gallery, swipe navigation, and rename
- Upload queue with background sync engine
- Admin panel for Nextcloud user management
- Service worker for offline-first caching (v13)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>