try something

This commit is contained in:
jif-oai
2025-11-12 11:57:13 +00:00
parent 769e9cc92c
commit fe95c24442
2 changed files with 38 additions and 2 deletions

View File

@@ -77,7 +77,20 @@ pub async fn process_sse_wire<S, D>(
}
}
}
Ok(None) => return,
Ok(None) => {
// If the stream ended without a trailing blank line, flush any
// buffered JSON frame to the decoder before returning.
if !data_buffer.is_empty() {
let json = std::mem::take(&mut data_buffer);
if let Err(e) = decoder
.on_frame(&json, &tx_event, &otel_event_manager)
.await
{
let _ = tx_event.send(Err(e)).await;
}
}
return;
}
}
}
}