fix(reliability): prevent webview postMessage crashes and make dispose idempotent#11313
Open
0xMink wants to merge 1 commit intoRooCodeInc:mainfrom
Open
fix(reliability): prevent webview postMessage crashes and make dispose idempotent#113130xMink wants to merge 1 commit intoRooCodeInc:mainfrom
0xMink wants to merge 1 commit intoRooCodeInc:mainfrom
Conversation
…e idempotent Closes: RooCodeInc#11311 1. postMessageToWebview() now catches rejections from webview.postMessage() so that messages sent after the webview is disposed do not surface as unhandled promise rejections. 2. dispose() is guarded by a _disposed flag so that repeated calls (e.g. during rapid extension deactivation) are no-ops. 3. CloudService mock in ClineProvider.spec.ts updated to include off() — a pre-existing gap exposed by the new dispose test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Reviewed the changes. No issues found -- the
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
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.
Closes: #11311
Summary
dispose(): Added_disposedguard so repeated calls (e.g. during rapid extension deactivation) are no-ops.postMessageToWebview()rejections: Wrappedwebview.postMessage()in try/catch so messages sent after the webview is disposed do not surface as unhandled promise rejections.CloudServicemock to includeoff()— a pre-existing gap exposed by the new dispose test.Test plan
postMessageToWebviewdoes not throw when webview is disposeddispose()is idempotent — second call is a no-opRoadmap alignment: Reliability First
Important
Make
dispose()idempotent and handle promise rejections inpostMessageToWebview()inClineProviderto improve reliability.dispose()inClineProvideridempotent by adding_disposedflag to prevent repeated execution.postMessageToWebview()inClineProviderwith try/catch to handle promise rejections when webview is disposed.postMessageToWebviewto ensure no error is thrown when webview is disposed.dispose()to verify it is idempotent and logs only once.CloudServicemock to includeoff()method inClineProvider.spec.ts.This description was created by
for e0808ae. You can customize this summary. It will automatically update as commits are pushed.