fix: URL-encode Signal phone numbers and correct attachment RPC parameter#3670
Merged
teknium1 merged 2 commits intoNousResearch:mainfrom Mar 29, 2026
Merged
Conversation
…eter Two bugs in the Signal adapter caused failures for users: 1. SSE connection: Phone numbers with + (e.g. +31612345678) were not URL-encoded in the SSE query string, causing the + to be interpreted as a space and resulting in 400 Bad Request errors. 2. Attachment download: The getAttachment RPC used parameter name "attachmentId" but signal-cli expects "id", causing a NullPointerException and failing all attachment downloads.
- Extract shared _make_signal_adapter() and _stub_rpc() helpers - Remove duplicated _make_adapter/_make_config across 3 test classes - Remove brittle inspect.getsource test (tested impl text, not behavior) - Remove unused adapter creation and redundant assertions - Use captured call list instead of mutating dict for RPC mock
6d60eb2 to
c6e9866
Compare
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.
Summary
+(E.164 format like+31612345678) were passed raw into the SSE query string. The+was interpreted as a space by the HTTP server, causing400 Bad Requesterrors and breaking all inbound message reception. Fix:quote(self.account, safe='')encodes+as%2B.getAttachmentJSON-RPC call used parameter nameattachmentId, but signal-cli expectsid. This caused aNullPointerExceptionin signal-cli, silently failing all attachment downloads (images, documents, audio). Fix: rename parameter toid.Both bugs were reported by a user whose Signal interactions were broken on every upstream update because the fixes kept getting overwritten.
Test plan
TestSignalSSEUrlEncoding— verifies+is percent-encoded as%2Bin SSE URLsTestSignalAttachmentFetch— verifies RPC usesid(notattachmentId), handles empty responses, and correctly unwraps dict responsespython -m pytest tests/gateway/test_signal.py -q)