Skip to content

fix: update version in package.json and add tests for audio restore l…#11

Merged
MusicMaster4 merged 1 commit into
testingfrom
fix/unmute-behaviour
Jul 9, 2026
Merged

fix: update version in package.json and add tests for audio restore l…#11
MusicMaster4 merged 1 commit into
testingfrom
fix/unmute-behaviour

Conversation

@MusicMaster4

Copy link
Copy Markdown
Owner

…ogic

@MusicMaster4 MusicMaster4 merged commit e165ea6 into testing Jul 9, 2026
3 checks passed
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown

Greptile Summary

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.

Reviews (1): Last reviewed commit: "fix: update version in package.json and ..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant