mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-21 09:02:32 +00:00
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:
parent
b647aa5f47
commit
79c23787f6
@ -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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user