mirror of
https://github.com/block/buzz.git
synced 2026-11-28 20:22:39 +00:00
fix(desktop): guard document at settle entry; pin rotation in concurrent test
Blind-review round 14 (Opus medium) P3s: - settleChannelSwitchTrace guarded window but then read document (visibilityState, querySelector) unguarded — the document guard in ensureVisibilityWatcher was dead protection. The settle entry gate now covers both globals. - The concurrent boundary test folded the rotated generation in behind if-let, so a regression where rotation never fires under contention would pass green with all 32 lines in the live file. The read is now unconditional, and the boundary comment's arithmetic is corrected (rotation triggers before the 23rd append). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Max Lampert <maxwell@squareup.com>
This commit is contained in:
@@ -416,7 +416,9 @@ export function settleChannelSwitchTrace(channelId: string): void {
|
||||
return;
|
||||
}
|
||||
const trace = settledTrace;
|
||||
if (typeof window === "undefined") {
|
||||
// Both globals gate the whole settle path: the wait loop reads
|
||||
// document.visibilityState and querySelector unguarded past this point.
|
||||
if (typeof window === "undefined" || typeof document === "undefined") {
|
||||
activeTrace = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user