Hide transient upload errors from queue UI

Transient network errors on first upload attempt showed ugly
'Network error: TypeError: Load failed' messages in the queue.
These are normal on iOS Safari and auto-resolve on retry.

- Clean up sync error messages (friendly text, no raw error types)
- Only show error messages in queue after 3+ retries or failed status
- Only show retry counter after 3+ retries
- First couple of retries are silent - just shows Pending status

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 21:11:21 -06:00
parent 5f354bb5fc
commit 06e90bbe4e
2 changed files with 11 additions and 11 deletions

View File

@@ -192,12 +192,10 @@ const Sync = {
} catch (fetchErr) {
clearTimeout(timeoutId);
if (fetchErr.name === 'AbortError') {
throw new Error('Upload timed out (' + (this.UPLOAD_TIMEOUT_MS / 1000) + 's)');
throw new Error('Upload timed out');
}
// Capture detailed error info for debugging
const errDetail = fetchErr.name + ': ' + fetchErr.message;
console.error('[SYNC] Fetch threw:', errDetail);
throw new Error('Network error: ' + errDetail);
console.error('[SYNC] Fetch threw:', fetchErr.name, fetchErr.message);
throw new Error('Connection lost - will retry');
}
clearTimeout(timeoutId);
@@ -253,13 +251,12 @@ const Sync = {
} catch (error) {
this._setUploading(false);
const errMsg = (error.name || 'Error') + ': ' + error.message;
console.error('[SYNC] Upload failed:', errMsg, '(attempt', retryCount + 1 + ')');
console.error('[SYNC] Upload failed:', error.message, '(attempt', retryCount + 1 + ')');
await Storage.updatePhoto(photo.id, {
status: 'pending',
retryCount: retryCount + 1,
lastError: errMsg,
error: errMsg
lastError: error.message,
error: error.message
});
return false;
}