-
Notifications
You must be signed in to change notification settings - Fork 46
Add onRenderProcessGone override to webview logic, Fixes AB#3405900 #2788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
✅ Work item link check complete. Description contains link AB#3405900 to an Azure Boards work item. |
|
❌ Work item link check failed. Description contains AB#3405900 but the Bot could not link it to an Azure Boards work item. Click here to learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds error handling for WebView render process crashes to prevent ANRs in calling applications. When the WebView render process fails, the new onRenderProcessGone override catches the crash and sends an error to the callback instead of letting the exception propagate uncaught.
- Overrides
onRenderProcessGonemethod to handle WebView process crashes gracefully - Implements version-specific error messages based on Android SDK level
- Returns true to indicate the crash was handled successfully
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Outdated
Show resolved
Hide resolved
…/webview/OAuth2WebViewClient.java Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/OAuth2WebViewClient.java
Outdated
Show resolved
Hide resolved
…tion-library-common-for-android into fadi/ltw-anr-fix origin fnecessary,
…/webview/OAuth2WebViewClient.java Co-authored-by: Copilot <[email protected]>
We do not gracefully handle webview process crashes, which can cause ANRs for calling activitties (LTW bug: https://dev.azure.com/microsoft/OS/_workitems/edit/59756442). In this PR we override the webview method onRenderProcessGone to handle what to do if webview no longer is able to render content, where we send the error to the callback rather than having an uncaught exception.
AB#3405900