You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Martin Littkovsky
committed
[amazonechocontrol] Buffer push stream data until a message is complete
Since mid-August 2026 Amazon delivers push messages split over several
HTTP/2 DATA frames (#21426). PushStreamAdapter parsed every DATA
frame as if it were a complete multipart part: the first fragment of a
split message failed with "MalformedJsonException: Unterminated string",
the second produced "Don't know how to handle frame starting with ...",
both at WARN for every single message, and the message itself was lost.
The adapter now collects the raw bytes and processes a part only once
its trailing boundary marker has arrived; a single frame may equally
carry several parts. Fixed in the same path because the new code
depends on it:
- an incomplete part was logged as discarded but processed anyway
(missing return)
- frame content was decoded with the platform default charset before
re-assembly; parts are now decoded as UTF-8 and only when complete,
so a multi-byte character split across frames survives
- the DATA frame callback was never completed, so consumed bytes were
never returned to the HTTP/2 flow control window (Jetty replenishes
it in DataCallback.succeeded) and a busy long-lived stream would
stall for good once the initial window is exhausted
- a part that fails to process - a real format change, not
fragmentation - is dropped and the stream re-synchronizes at the
next boundary, logging one body-free WARN per failure streak, so a
future API evolution can neither wedge the stream nor flood the log
- the delimiter is accepted both as the bare boundary parameter and
as "--" + parameter (RFC 2046), whichever Amazon actually sends
Signed-off-by: Martin Littkovsky <2018turtle@proton.me>
AI-assisted-by: Claude Code
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/push/PushStreamAdapter.java
0 commit comments