VS Code PR #344094: Why SSE Parsing Stripped the Wrong BOMs
Microsoft VS Code PR #344094 fixes an SSE parser that could turn an unrecognized field into event data by removing a character from its name. The parser used one TextDecoder object, but ended its decoding session at every completed line. The next line started with fresh byte order mark handling. A U+FEFF character at the beginning of that line could disappear even though it was no longer at the beginning of the stream. For this input, with the invisible character shown as an escape: data: first\n\uFEFFdata: second\n\n the old parser emitted first\nsecond . The expected event contained only first . The fix keeps decoding state across lines and includes the line terminator in decoding before removing it from the resulting string. Those two choices preserve both field names and malformed UTF-8 handling. The change merged on October 28, 2026, as commit e01c8bd0f8e5d846fcb3a7747d2f0b01741d4b1e . The extra character changes the field name Server-sent events carry text fields such as da...