Skip to content

fix(chat): send photos offline and fail them promptly - #982

Merged
bmc08gt merged 4 commits into
mainfrom
fix/chat-photo-offline-send
Oct 6, 2026
Merged

bmc08gt merged 4 commits into
mainfrom
fix/chat-photo-offline-send

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Offline, a photo whose upload failed blocked Send and stayed in the composer. Once a photo got past the store step, losing the network during finalization held its row at Sending for about 8 minutes before Not Delivered. This mirrors the Android fixes in code-payments/code-android-app#1681–#1683.

Send a photo that failed offline. Only a chip that failed for good (moderation, no usable upload constraint, encoding) blocks Send now. Sending a retryable chip restarts its upload and posts the row as Sending; if the retries run out it lands on Not Delivered with retry through the existing retryMedia path.

Stop waiting on finalization after three lost polls. Each offline poll waits out the 15s .unaryDefault deadline, and the 30-poll budget counted it as one more poll. Three lost in a row now throw ErrorBlob.network, roughly 50s, which the chat uploader keeps retryable. A retry resumes polling the stored blob rather than uploading again, and one or two lost polls after a suspend still recover.

Keep a photo retryable when its chat can't be fetched offline. The seal lookup calls getChat when the chat isn't cached. It already has a 15s deadline, but offline its transportFailure was wrapped as a permanent sealUnavailable, so the chip failed for good and the pending send was dropped. A transport failure there is now retryable and reports as suppressed.

Double-tap a photo to react. Double tap only reached text bubbles; on a photo the first tap opened the viewer. Photos that can take a reaction now do, and the viewer tap waits for the double tap to fail, so a single tap on those photos opens the viewer about 0.3s later. Redacted and still-sending photos open immediately as before.

A chip that failed for a network reason blocked Send, so offline the
message stayed in the composer. Only a failure another upload can't fix
(moderation, a missing upload constraint) blocks it now. Sending a
retryable chip restarts its upload and posts the row as Sending; if the
retries run out it lands on Not Delivered with retry, as before.
Offline, each finalization poll waits out its 15s deadline and the
30-poll budget treated it as one more poll, so a photo sat at Sending
for about 8 minutes. Three polls lost in a row now throw
ErrorBlob.network (about 50s), which the chat uploader keeps retryable,
and a retry resumes polling the stored blob rather than uploading again.
One or two lost polls after a suspend still recover.
The seal lookup fetches the chat when it isn't cached. Offline that
throws ErrorGetChat.transportFailure, which sealUnavailable treated as
permanent: the chip failed for good and its pending send was dropped.
A transport failure under sealUnavailable is now retryable and reports
at the inner error's level, which is suppressed for transport failures.
Double tap only reached text bubbles; on a photo the first tap opened
the viewer. Photos that can take a reaction now take the double tap,
and their open-the-viewer tap waits for it to fail. Photos that can't
react (redacted, still sending) open on a single tap with no wait.
@bmc08gt bmc08gt self-assigned this Oct 6, 2026
@bmc08gt
bmc08gt merged commit a71fcfb into main Oct 6, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant