Fix upload stuck pending: validate blob readability before upload
iOS Safari can evict blob data from IndexedDB while keeping the Blob reference intact (instanceof/size checks pass but actual data read fails). This caused upload POST to throw 'Load failed' client-side, never reaching the server, burning retries endlessly. Changes: - Add validateBlobReadable() that reads first byte to verify data access - If blob is unreadable, mark as 'failed' immediately with clear message - Re-read photo from IndexedDB before upload for fresh blob reference - Capture detailed error name/type in catch for better diagnostics - Bump SW cache versions to v14/v10 to force new code delivery Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
// NextSnap Service Worker
|
||||
// Provides offline-first caching for the app shell
|
||||
|
||||
const CACHE_VERSION = 'nextsnap-v13';
|
||||
const APP_SHELL_CACHE = 'nextsnap-shell-v9';
|
||||
const RUNTIME_CACHE = 'nextsnap-runtime-v9';
|
||||
const CACHE_VERSION = 'nextsnap-v14';
|
||||
const APP_SHELL_CACHE = 'nextsnap-shell-v10';
|
||||
const RUNTIME_CACHE = 'nextsnap-runtime-v10';
|
||||
|
||||
// Assets to cache on install
|
||||
const APP_SHELL_ASSETS = [
|
||||
|
||||
Reference in New Issue
Block a user