Upload failures keep name, size and file readability #34
Loading…
Reference in a new issue
No description provided.
Delete branch "void/upload-error-diagnostics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Meta cannot attach images from Android Chrome: UI shows
MatrixError: Unknown message.Observed in source: matrix-js-sdk 41.7 XHR upload throws
DOMException(xhr.statusText, "AbortError")when status is 0. statusText is empty, our catch usede.messagefor errcode and kept the empty message, so MatrixError fell back to "Unknown message".This PR only fixes the diagnosis.
uploadFailuresets errcode frome.name, keepscause, and the upload card message now carries name, size, type, and whetherfile.arrayBuffer()still reads the file after the failure.Cause of the status-0 on Android is NOT established. Candidates (unobserved): unreadable content:// Blob, big body over VPN/MTU. The new message tells them apart on the next failure.
Tests: uploadFailure.test.ts (red before, 6 green after). Full suite: 249/250; soundscape.test.ts fails with
window is not defined, a file this PR does not touch, not checked against dev.🤖 Generated with Claude Code
Added after Meta's phone traces (head
25765c44)Follow-up, not touched here
UploadCardRenderer.tsx:125-127 (and CompactUploadCardRenderer.tsx) call startUpload() during render while the upload status is Idle. Status leaves Idle only when onPromise sets the promise, so a render that happens first (e.g. StrictMode double render) can start the same upload twice. Not shown to be happening; not an abort path. Left as is on purpose.