Skip to content

fix(debug-controller): drop recorded actions when recording session ends - #42458

Open
Ashraf Ali (ashrafiucse) wants to merge 1 commit into
microsoft:mainfrom
ashrafiucse:fix-42218
Open

fix(debug-controller): drop recorded actions when recording session ends#42458
Ashraf Ali (ashrafiucse) wants to merge 1 commit into
microsoft:mainfrom
ashrafiucse:fix-42218

Conversation

@ashrafiucse

@ashrafiucse Ashraf Ali (ashrafiucse) commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • clear the accumulated recorder actions when the recorder mode switches to none, so the next recording session on the same page starts from a clean list
  • the list was never cleared before, so a late signal (dialog, navigation, popup) re-rendered a stale previous-session action as the last one, and clients diffing by count - e.g. the VS Code extension's "Record at cursor" - inserted that stale action into the editor

Addresses the cross-session variant of #42218. The mid-recording variant is fixed on the extension side: microsoft/playwright-vscode#807

Related: #42461 keeps the browser open after stopping a debug session, extending the record-after-debug workflow (#37822).

The debug controller accumulates recorder actions in a closure and
re-sends the full list in every `sourceChanged` event. The list was
never cleared when recording was disabled, so a subsequent recording
session on the same page leaked the previous session's actions: a late
signal (dialog, navigation, popup) re-rendered a stale action as the
last one, and clients that diff by count - like the VS Code extension's
"Record at cursor" - inserted that stale action into the editor.

Clear the accumulated actions when the recorder mode switches to
'none', so each session starts from a clean list.

Fixes: microsoft#42218
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