You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes a race condition in the audio duck-restore fallback logic where an unrelated muted Chrome tab could steal a pending snapshot intended for a different ducked Chrome tab, and defers the follow-up retry budget in main.js so that early restore-complete responses cannot exhaust retries before the final 5-minute fixed-delay timer fires.
GetProcessNamesAllowingFallback (PowerShell/C#): New helper that gates process-name fallback to only those process names where every live session is still ducked and the snapshot count exactly matches the ducked-session count, preventing cross-tab snapshot theft.
schedulePendingAudioRestores (main.js): Follow-up retry budget now starts at 0 and is armed to AUDIO_PENDING_RESTORE_FOLLOWUP_MAX only when the last fixed-delay timer fires, preventing premature budget exhaustion.
Tests: New unrelated-muted-tab-skips-process-name-fallback case wired into both the PowerShell self-test and the JS test runner's required-cases list.
Confidence Score: 4/5
Safe to merge. Both behavioral changes are well-scoped, independently testable, and defended by new self-tests that exercise the exact failure scenarios they address.
The deferred-budget logic in schedulePendingAudioRestores relies on engageCaptureMute reliably cancelling timers before they fire; that assumption holds in Node.js's single-threaded model but is not enforced by tests.
src/main/main.js — the scheduleAudioRestoreTimer onFire interaction warrants a second look if the timer chain is refactored.
Important Files Changed
Filename
Overview
package.json
Version bump from 1.3.042 to 1.3.043, matching the x.x.xxx format required by AGENTS.md.
scripts/system_audio_controller.ps1
Adds GetProcessNamesAllowingFallback to tighten process-name fallback matching, threads the resulting HashSet through FindRestoreSnapshotForLive (Pass 2 receives null to keep it identity-only), and adds test case 5b for the unrelated-muted-tab scenario.
scripts/test-duck-restore.js
Registers the new unrelated-muted-tab-skips-process-name-fallback case in the required-pass list; no logic changes.
src/main/main.js
Defers follow-up budget to the last fixed-delay timer via an onFire callback; onFire is skipped when captureMuteDepth > 0 or isQuitting, which is correct in practice but worth noting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ogic