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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user