fix: don't insert stale recorded action after user edits the file - #807
Open
Ashraf Ali (ashrafiucse) wants to merge 1 commit into
Open
fix: don't insert stale recorded action after user edits the file#807Ashraf Ali (ashrafiucse) wants to merge 1 commit into
Ashraf Ali (ashrafiucse) wants to merge 1 commit into
Conversation
When the recorder re-renders the last action (e.g. a dialog or assertion signal attached to it) while the user has edited the file during recording, the selection no longer spans the previously inserted text, so the old action was re-inserted at the user's cursor. Only update the editor on such re-renders while the selection still spans the text we had inserted. Fixes: microsoft/playwright#42218
This was referenced Aug 29, 2026
Open
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
sourceChangedre-render path: only update the editor while the selection still spans the exact text the extension previously inserted; when the user edited the file during recording, their edits are left alone instead of re-inserting the re-rendered action at their cursorFixes microsoft/playwright#42218
The cross-session variant (stale actions from a previous recording session) is fixed core-side: microsoft/playwright#42458
Related: #808 keeps the browser open after stopping a debug session, extending the record-after-debug workflow (microsoft/playwright#37822).