Skip to content

fix: arm overshoot swallow in handlePlayStatusNotify on real stop - #541

Closed
nabalone with Copilot wants to merge 2 commits into
TT-7621_pbt-record-after-playback-stopsfrom
copilot/fix-review-comment-529
Closed

fix: arm overshoot swallow in handlePlayStatusNotify on real stop#541
nabalone with Copilot wants to merge 2 commits into
TT-7621_pbt-record-after-playback-stopsfrom
copilot/fix-review-comment-529

Conversation

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown

handlePlayStatusNotify was advancing to recordReady and setting currentClausePlayed on a real stop, but unlike handleRegionPlayEnd it never armed pendingOvershootSwallowRef. This left the component exposed to the spurious +1 segment change that fires when the recorder mounts after allowRecord turns true — which gets misread as user navigation and may auto-play the next clause.

Change

  • After setCurrentClausePlayed(true) in handlePlayStatusNotify, arm the overshoot swallow, matching the existing pattern in handleRegionPlayEnd:
setCurrentClausePlayed(true);
pendingOvershootSwallowRef.current = true;   // ← added
setPhase((p) =>
  p === 'recording' || p === 'recorded' ? p : 'recordReady'
);

… stop

Co-authored-by: nabalone <22460975+nabalone@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code as per review comment on PR #529 fix: arm overshoot swallow in handlePlayStatusNotify on real stop Aug 25, 2026
Copilot AI requested a review from nabalone August 25, 2026 21:06
@nabalone

Copy link
Copy Markdown
Collaborator

See comment in TT-7621_pbt-record-after-playback-stops

@nabalone nabalone closed this Aug 25, 2026
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.

2 participants