-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Fix] IllegalArgumentException: in ReaderPostRenderer #20997
Conversation
Quality Gate passedIssues Measures |
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/25.1 #20997 +/- ##
================================================
- Coverage 40.99% 40.98% -0.01%
================================================
Files 1522 1522
Lines 69622 69625 +3
Branches 11489 11490 +1
================================================
Hits 28539 28539
- Misses 38494 38497 +3
Partials 2589 2589 ☔ View full report in Codecov by Sentry. |
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.
I also couldn't reproduce the crash but your solution looks reasonable to me. LGTM! 👍🏻
Fixes #20996
This PR is an attempt to fix IllegalArgumentException: jsObjectName wvHandler was already added.
The exception we are encountering indicates that the wvHandler JavaScript object name is being added multiple times to the WebView, which is not allowed. This can happen if setWebViewMessageHandler is called more than once for the same WebView instance without removing or properly handling the previously added JavaScript object.
To avoid this issue, this PR sets a tag on the webview and checks for the instance of that tag before the jsObject is added again.
Note: I was unable to recreate the issue, so please feel free to block this fix.
To Test:
As the issue can't be recreated, please test that the existing functionality works as expected. These test instructions were taken from #20895, as this is when the code was added.
Regression Notes
Potential unintended areas of impact
The crash still happens
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing
What automated tests I added (or what prevented me from doing so)
N/A
PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones): N/A