fix(server): remove a NUL byte from the fatal-error test file and an unref hazard on the exit path

The test file had one literal NUL byte in a string literal, so Git read
the whole file as binary and hid it from every diff. The fallback
string was unreachable, so the fix asserts on `error.stack` directly.

`flushWithTimeout` also called `timer.unref?.()`. An unreferenced timer
does not keep the event loop open, so a crash with no other open
handle could let Node exit with code 0 before `process.exit(1)` runs.
The 2-second bound already gives the same protection, so the line is
removed, and the timer now clears inside `finish` instead.

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Priya RamanandPaperclip committed 2026-08-27 21:15:28 +00:00
1 parent 2d6c3dc597
commit fb354fd0ff
2 files changed
+1 -1

No files matched your search

Binary file not shown.
+1 -1
View File
@@ -130,10 +130,10 @@ function flushWithTimeout(client: TelemetryClient, timeoutMs: number): Promise<v
const finish = () => {
if (settled) return;
settled = true;
clearTimeout(timer);
resolve();
};
const timer = setTimeout(finish, timeoutMs);
timer.unref?.();
client.flush().then(finish, finish);
});
}