fix: spell source NUL separators as Unicode escapes (#26864)

Co-authored-by: Matheus Breguêz <23284276+matbrgz@users.noreply.github.com>
This commit is contained in:
Neil
2026-10-10 21:04:49 -07:00
committed by GitHub
co-authored by Matheus Breguêz
parent bc02f3ce6e
commit 41de89a626
3 changed files with 3 additions and 3 deletions
@@ -300,7 +300,7 @@ function inlineRows(columns: ReadonlyArray<readonly [string, string]>, rows: num
}
function hostKey(row: SqlRow): string {
return `${String(row.user_id)}${String(row.relay_host_id)}`
return `${String(row.user_id)}\u0000${String(row.relay_host_id)}`
}
function idleRehomeCandidate(
@@ -330,5 +330,5 @@ function isDestinationExistsError(error: unknown): boolean {
}
function sessionKey(browserPageId: string, transferId: string): string {
return `${browserPageId}${transferId}`
return `${browserPageId}\u0000${transferId}`
}
+1 -1
View File
@@ -802,7 +802,7 @@ describe('RelayDispatcher', () => {
}
// Multi-byte UTF-8, astral pairs, lone surrogates, controls, quotes, and backslashes.
const alphabet = 'aZ9 "\\\n\r\té߀中𝄞😀𐀀�'
const alphabet = 'aZ9 "\\\n\r\t\u0000é߀中𝄞😀𐀀�'
it('matches the pre-optimization sizing loop across randomized inputs', () => {
const random = mulberry32(0xc0ffee)