fix(signal): join multi-line SSE data with newline per spec

Per the SSE spec, multiple data: lines within a single event must be
joined with \n before parsing. signal-cli emits single-line JSON so
this was latent, but the joining was wrong.

Addresses review comment on PR #3852.
This commit is contained in:
Kaloyan Tenchov 2026-05-19 08:58:04 -04:00 committed by chengyongru
parent b647aa5f47
commit 79c23787f6

View File

@ -557,7 +557,7 @@ class SignalChannel(BaseChannel):
# Try to parse the accumulated data # Try to parse the accumulated data
data_str = "" data_str = ""
try: try:
data_str = "".join(event_buffer) data_str = "\n".join(event_buffer)
data = json.loads(data_str) data = json.loads(data_str)
self.logger.debug(f"SSE event parsed: {data}") self.logger.debug(f"SSE event parsed: {data}")
await self._handle_receive_notification(data) await self._handle_receive_notification(data)