fix(mms): submit again when the modem cuts an upload short - #116
Merged
Merged
Conversation
The modem's MMSC socket occasionally answers SEND FAIL part way through an upload. The MMS was then marked failed with a message that dropped the modem's answer, and the same message sent by hand a moment later went through: on the test line a 303 KB picture failed after five seconds and a 297 KB one sent thirty seconds later arrived. A transport error now says whether the MMSC cannot have received the whole request: no connection was made, or the upload stopped before its last chunk. Such an attempt is submitted again on a fresh connection after 3 and then 10 seconds. A failure on the last chunk is not repeated, since those bytes may have left the modem, and a request that went out whole remains "unknown" and is never sent twice. The error carries the modem's answer and the offset where the upload stopped, so the next failure can be told apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 of 20 tasks
…oad deadline The request deadline scales with the upload size, so a connection that never opened held the modem, and every retry of it, for that long. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on
develop(v1.11.0); independent of #103.Summary
The modem's MMSC socket occasionally answers
SEND FAILpart way through an upload. An outgoing MMS was then marked failed at once, with an error that dropped the modem's answer, although the same message sent by hand a moment later went through. This submits such an attempt again, but only when the MMSC cannot have received the whole request, so a message is still never delivered twice.Changes
MmsTransportErrorgainsunsent-- no connection was made, or the upload stopped before its last chunk. A failure on the last chunk is notunsent, since those bytes may have left the modem.unsentattempt is submitted again on a fresh connection after 3 and then 10 seconds, then marked failed. A request that went out whole stays "unknown" and is never repeated, as before.... (modem answered: SEND FAIL), at byte 2920 of 310544.Upgrade impact
Safety and privacy impact
tools/check-subscriber-identifiers.sh --commitsclean).Testing
unsentand reported with its answer and offset; a refused last chunk is not; a connection that never opens is; send retries and then succeeds; send gives up after its delays; nothing that may have arrived whole is resubmitted.SEND FAILis followed by a successful resubmission in the log.中文
基于
develop(v1.11.0);与 #103 无依赖。概要
模块的 MMSC 连接偶尔会在上传途中返回
SEND FAIL。此前外发彩信会立刻被标记为失败,错误信息里也没有模块的原始答复,而同一条彩信稍后手动重发就能成功。本 PR 在这种情况下自动重发,但只限于 MMSC 不可能收到完整请求的情况,因此仍然不会让对方收到两条。改动
MmsTransportError新增unsent,表示连接没有建立,或上传在最后一块之前就中止。最后一块失败不算unsent,因为这些字节可能已经离开模块。unsent的尝试分别在 3 秒和 10 秒后换新连接重发,仍失败才标记为失败。已经完整发出的请求照旧标记为"未知",不会重发。... (modem answered: SEND FAIL), at byte 2920 of 310544。升级影响
安全与隐私影响
tools/check-subscriber-identifiers.sh --commits通过)。测试
unsent并报告答复和位置;最后一块被拒不算;连接未建立算;发送重试后成功;重试次数用完后放弃;可能已完整到达的请求不重发。SEND FAIL之后重发成功。🤖 Generated with Claude Code