Skip to content

filter-bar.test.ts has 4 raw NUL bytes, so rg and git treat it as binary #435

Description

@BorisTyshkevich

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.

Activity

  1. added
    inboxFiled mid-task; not yet triaged into the roadmap
    bugSomething isn't working
    lowlow priority
    and removed
    inboxFiled mid-task; not yet triaged into the roadmap
    on Jul 25, 2026
  2. BorisTyshkevich commented on Jul 29, 2026

    @BorisTyshkevich
    CollaboratorAuthor

    Closing as already resolved — no code change was needed, and none was made.

    The file this issue names no longer exists. tests/unit/filter-bar.test.ts was renamed to tests/unit/variable-bar.test.ts by the #459 terminology rename, which also replaced the four raw 0x00 bytes with a single escaped GROUP_KEY constant — the same escape production uses when building the time-range group key.

    Verified independently against origin/main rather than trusting the rename: scanning every blob in the tree, no file under src/ or tests/ contains a NUL byte. The only files that do are PNGs under docs/assets/img/ and docs/ui-snapshots/, which is expected.

    So both halves of the fix this issue asked for are in place — the string values are unchanged and the spec is plain text, searchable by rg and diffable by git.

    Found while sweeping the bug+low backlog alongside #455 and #498 (PR #554). Filed here rather than in that PR because nothing in the PR fixes this — it was already fixed elsewhere.

  3. added a commit that references this issue on Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglowlow priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions