fix: coalesce pending session replay captures per window - #764
Merged
Conversation
Member
Author
|
quick follow up for #761 |
Contributor
|
Reviews (1): Last reviewed commit: "fix: coalesce pending session replay cap..." | Re-trigger Greptile |
dustinbyrne
approved these changes
Sep 7, 2026
dustinbyrne
left a comment
Contributor
There was a problem hiding this comment.
The per-window capture gate preserves draw-time privacy observation, eligibility checks and teardown. No material issues found in the implementation or applicable SDK contracts.
6 tasks
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.
💡 Motivation and Context
Session replay can keep submitting draw-triggered captures while its worker waits up to one second for PixelCopy. This queues redundant work for the same window.
Allow only one queued or running capture per window. Native draw requests and wrapper-driven snapshots share the same check. Duplicate requests are skipped, and the next draw or wrapper tick can retry. Other windows can still schedule captures.
Keep the window busy after a PixelCopy timeout until its callback finishes. Draw-time mask verification still runs on every draw. Capture failures and rejected submissions release the pending task, while stop and session resets do not release unfinished work.
This keeps the existing synchronous worker wait. It does not convert capture to callback-driven completion.
💚 How did you test it?
make test: 356 tests passed and 3 skipped.make checkFormatandgit diff --checkpassed.cec2221dagainstorigin/mainreported no actionable findings.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with Pi using Git, Gradle, Changesets, and the isolated autoreview helper. The requested scope was to skip redundant captures per window without replacing the PixelCopy wait. The callback is tracked separately so a timeout cannot allow another capture while the previous callback is still running. Human review is required.