fix(desktop): guard WebView getWebContentsId against detached DOM#152
Conversation
The dom-ready event can fire after the WebView has been detached from the DOM (isTrusted: false synthetic event), causing getWebContentsId() to throw. Add isConnected check and try-catch to prevent the crash. Fixes ELECTRON-19
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 10 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f0860d125
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Restructure the dom-ready handler so the pending-URL drain always runs, even when the WebView is temporarily disconnected from the DOM. This prevents queued navigations from getting stuck indefinitely when dom-ready fires during wrapper moves.
Summary
dom-readyイベントがDOM切り離し後に発火した場合にgetWebContentsId()がクラッシュする問題を修正wv.isConnectedチェックとtry-catchガードを追加Sentry Issue
isTrusted: falseの合成イベント)調査結果
Sentry全66件のissueを調査した結果:
Test plan