fix(video): don't leave a stale test annotation overlay in the page - #42797
Open
Denis (someden) wants to merge 2 commits into
Open
Denis (someden) wants to merge 2 commits into
Denis (someden) wants to merge 2 commits into
Conversation
installScreencastTitleUpdater() updates the caption from two places: the test.step callbacks and the 'page' event. The page handler is fire-and-forget, and an update reads overlays.get(page) before awaiting showOverlay(), so a step that begins while a page-event update is in flight finds nothing to remove and adds a second overlay. The reference to the first one is lost and it stays in the page for the rest of the recording. Both overlays are anchored to the same edge and differ by one line, so the previous caption line is drawn over the current one — a ghost that shows wherever it is longer than the text on top of it. With the default top-left position the two line up and the duplicate goes unnoticed; with a bottom position it is plainly visible in the video. Serialize the updates into a promise chain so removing the previous overlay and adding the next one cannot interleave. A failed update no longer breaks the chain, but is still reported to whoever awaited it.
Author
|
@microsoft-github-policy-service agree |
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.
installScreencastTitleUpdater() updates the caption from two places: the test.step callbacks and the 'page' event. The page handler is fire-and-forget, and an update reads overlays.get(page) before awaiting showOverlay(), so a step that begins while a page-event update is in flight finds nothing to remove and adds a second overlay. The reference to the first one is lost and it stays in the page for the rest of the recording.
Both overlays are anchored to the same edge and differ by one line, so the previous caption line is drawn over the current one — a ghost that shows wherever it is longer than the text on top of it. With the default top-left position the two line up and the duplicate goes unnoticed; with a bottom position it is plainly visible in the video.
Serialize the updates into a promise chain so removing the previous overlay and adding the next one cannot interleave.
The page list each update works from is a snapshot, so a page that closes while its overlay is being updated rejects the call and aborts the loop — and because the step callbacks await it, that surfaces as the user's test failing with
screencast.showOverlay: Target page, context or browser has been closed. The annotation is cosmetic, so each page is now updated on its own and failures go to the debug log instead of the test.fixes #42796