fix(translation): accept SSE data without a space - #404
Conversation
Signed-off-by: Ting-Hong Shieh <32212900+ting-hong-shieh@users.noreply.github.com>
Before / after output snapshotI ran the same in-process SSE decode at the PR base ( Input: Before ( {"decoded_text":"","event_count":0}Both no-space After ( {"decoded_text":"Hello","event_count":1}The JSON field is decoded and the no-space |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughThe SSE parser now accepts ChangesSSE parser fix
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to The decoder now accepts valid SSE data fields with or without one optional space, with no actionable merge-blocking risk remaining after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
What
data:{...}anddata: {...}SSE fieldsdata:[DONE]in the shared stream decoderWhy
The SSE parser matched only the literal
data:prefix, so valid upstream events without the optional space were silently ignored.Closes #399
Validation
cargo test -p switchyard-translation decode_stream_accepts_sse_data_without_optional_space -- --nocapture— passedcargo test -p switchyard-translation— passedcargo fmt --all --check— passedcargo clippy --workspace --all-targets -- -D warnings— passedcargo test --workspace— passed with loopback access enabled for the repository's local mock serversgit diff --check— passedNo live provider calls or secrets were used.
Summary by CodeRabbit
[DONE].