Repository navigation
fix(computer-use): guard webContents before checking isDestroyed on tab stop - #6483
Open
sentry[bot] wants to merge 1 commit into
Open
sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
Contributor
Contributor
There was a problem hiding this comment.
Warden clearance. Complete security and confidentiality review of d0071c0241875aa4de394b00af8a016446ac007a found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run
Contributor
Warden: approvedNo high or medium security findings and no confidentiality findings. Reviewed |
This branch is waiting to be deployed
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.
What is this about?
This fixes a crash in the computer-use browser task when a browser tab is closed.
What problem does it solve?
When a tab's
destroyedevent fires, for example from CDPTarget.closeTargetor a page-initiated close, Electron'sview.webContentsreturnsundefined. The resulting code path throws a fatalTypeError.What was the situation before?
The
destroyedevent triggerscloseBrowserTab->taskHost.invalidate->stopControl->controller.abort(). That synchronously invokes the abort signal'sstoplistener. Line 829 calledtab.view.webContents.isDestroyed()without checking whethertab.view.webContentswas undefined.How is this implemented?
packages/computer-use/browser-task.mjs:829: adds a null check fortab.view.webContentsbefore calling.isDestroyed()in the abort signal stop handler.packages/computer-use/browser-task.mjs:636: adds the same null check before calling.isDestroyed()in the tab-pause loop.What else changed?
none
Release note
none
Fixes DESKTOP-APP-5T
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry at no cost. You can adjust this setting at any time.