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>
Filenames now include milliseconds (e.g. kamaji_20260207_143022347.jpg)
so rapid consecutive captures don't produce identical names and
overwrite each other on Nextcloud.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds an "Upload from Library" button below the camera button
that opens the device photo picker (no capture attribute) with
multi-select support. Selected photos are converted to JPEG and
queued for upload, with a progress counter during processing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous approach used setTimeout to re-trigger the file input
after each capture, which iOS Safari blocks because it loses the
user gesture context.
Now uses getUserMedia for a fullscreen camera viewfinder that stays
open between shots. Shutter button captures frames from the video
stream, saves to IndexedDB, and the camera remains open until the
user taps close. Includes flash feedback, session counter, and
camera flip. Falls back to single-shot file input if getUserMedia
is unavailable.
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>