Repository navigation
connector: resend group messages as plain text when LINE says a member has Letter Sealing off - #311
Open
indent[bot] wants to merge 2 commits into
Open
indent[bot] wants to merge 2 commits into
indent[bot] wants to merge 2 commits into
Conversation
…r has Letter Sealing off
Contributor
Author
|
All clear! No issues remaining. 🎉 1 issue already resolved
All CI checks passed on
Select any unchecked box below to run or rerun that agent. Full resultsIndent Review Agent
|
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.
Fixes PLAT-40295
Logs: In 24h, prod logged
Failed to handle Matrix messagewithTalkException code 98 "member settings off"from SendMessage. That's 8 lines from 3 accounts across 4 groups. Before each failure the same three lines appear:No group key found, auto-registering, thenAuto-register group key failed(code 98), thenfetchAndUnwrapGroupKey before encrypt failed. Neither the plain-text fallback warning norSending plain text message (no E2EE)shows up.Cause: Once a member turns Letter Sealing off, LINE stops serving a group key. The fetch error counts as "no usable key", but
EncryptGroupMessageRawstill succeeds with the group key the runtime cached earlier. LINE then rejects the encrypted send with code 98. Nothing after the send handles that code, so the message fails. The plain-text fallback only runs when encryption itself fails. Groups with no cached key already take that fallback and send fine (156 a day across all clusters).Change: If SendMessage rejects an encrypted group message with code 98 "member settings off", the bridge now marks the group as no-E2EE (the existing 1h cache), converts the message to plain text and resends once. The conversion is the same code the existing fallback uses, moved into one closure, and it keeps the sticon REPLACE metadata. A new
line.IsMemberSettingsOffhelper parses the TalkException.Before / after (sweep tester, 2026-11-10; base
ae61689vs head0923a43):go build ./...,go vet(all butpkg/ltsm) andgo test ./...pass on both. Not a real account: the realHandleMatrixMessage,fetchAndUnwrapGroupKeyand LTSM group encryption ran against a stubbed LINE HTTP transport. The group key is fetched and unwrapped once, so it's cached like a group that used to have Letter Sealing. After that LINE answers the way prod logs show:getLastE2EEGroupSharedKeygives code 5, auto-register gives code 98, and the encryptedsendMessagegives code 98 "member settings off". The harness is untracked and nothing was committed.No group key found, auto-registering,Auto-register group key failed,fetchAndUnwrapGroupKey before encrypt failed), no fallback...member has Letter Sealing off, resending as plain text, then 1 plain resend with the same text. Delivered, group marked no-E2EEr/talk/m/<id>plus a previewFILE_NAME=notes.xyz.zipandFILE_SIZE=166. The upload is the same 166-byte valid zip and contains the original fileline.IsMemberSettingsOff%w-wrapped and double-wrapped errors and for a reason in another case. False for code 99, code 98 with another reason, a non-TalkException, plain text, nil andErrNoUsableE2EEGroupKeyNote, not caused by this PR: on the image fallback
FILE_SIZEkeeps the encrypted size (174 vs 142 plain bytes). The existing pre-send fallback does the same.Real-account blocker: none of the sweep's accounts is a LINE account, and LINE login needs a phone-registered account (email/password plus PIN, or a QR scan from the LINE app). The run can't create one unattended. To get a real before/after, a person needs to sign a LINE test account into both builds. The account must be in a group whose key it already cached, then another member turns Letter Sealing off before a text and an image are sent.
Tag
@indentto continue the conversation here.