Found while shipping #425.
What
tests/unit/filter-bar.test.ts contains 4 raw NUL bytes (committed in c9f6505, #412).
They are the time-range group-key delimiter, written as a literal 0x00 byte inside
string literals rather than as a JavaScript unicode escape for code point zero — which is
what production uses: src/core/time-range.ts:183 builds the group key by joining
fromFilter.id and toFilter.id with that escaped code point.
Byte offsets in the committed file: 31689, 35196, 36936, 38846 — e.g. the fixture's
key: 'from<NUL>to' and const key = 'group:from<NUL>to'.
Why it matters
The string VALUES are correct, so the tests pass and assert the right thing. But the raw
byte makes tooling treat the whole 39 KB spec as binary: rg refuses to search it
("binary file matches"), git diff can flag it, and editors may mangle it on save. It
cost real time while shipping #425 — a routine rg for buildFilterBar in that file
returned only "binary file matches" instead of the call sites.
Why deferred
Purely cosmetic and unrelated to #425's scope; touching it would have added unrelated
churn to that PR's diff. (#425 preserved the bytes exactly rather than rewriting them
silently.)
Fix
Replace each literal NUL byte with the escape sequence, so the file is plain text while
every string's VALUE stays identical. npm test should be green with no other edit.
Found while shipping #425.
What
tests/unit/filter-bar.test.tscontains 4 raw NUL bytes (committed in c9f6505, #412).They are the time-range group-key delimiter, written as a literal
0x00byte insidestring literals rather than as a JavaScript unicode escape for code point zero — which is
what production uses:
src/core/time-range.ts:183builds the group key by joiningfromFilter.idandtoFilter.idwith that escaped code point.Byte offsets in the committed file: 31689, 35196, 36936, 38846 — e.g. the fixture's
key: 'from<NUL>to'andconst key = 'group:from<NUL>to'.Why it matters
The string VALUES are correct, so the tests pass and assert the right thing. But the raw
byte makes tooling treat the whole 39 KB spec as binary:
rgrefuses to search it("binary file matches"),
git diffcan flag it, and editors may mangle it on save. Itcost real time while shipping #425 — a routine
rgforbuildFilterBarin that filereturned only "binary file matches" instead of the call sites.
Why deferred
Purely cosmetic and unrelated to #425's scope; touching it would have added unrelated
churn to that PR's diff. (#425 preserved the bytes exactly rather than rewriting them
silently.)
Fix
Replace each literal NUL byte with the escape sequence, so the file is plain text while
every string's VALUE stays identical.
npm testshould be green with no other edit.