Skip to content

Fix Sentry JETPACK-ANDROID-1G9S and 1J82: avoid openUrl with empty url - #23147

Closed
nbradbury wants to merge 1 commit into
trunkfrom
fix/sentry-reader-openurl-empty
Closed

Fix Sentry JETPACK-ANDROID-1G9S and 1J82: avoid openUrl with empty url#23147
nbradbury wants to merge 1 commit into
trunkfrom
fix/sentry-reader-openurl-empty

Conversation

@nbradbury

Copy link
Copy Markdown
Contributor

Description

Fixes two Sentry issues that share a root cause:

Neither is a crash. ReaderActivityLauncher.openUrl() already guards null/empty urls by logging a Sentry report and returning (added in #22830 to stop the original crash), so what's left is two call sites passing empty urls — each of which also leaves the user tapping a button that silently does nothing.

CommentDetailFragment only checked getAuthorUrl() != null, so an empty author url still wired up a dead click listener on the commenter's name/avatar; it now falls through to the existing non-clickable styling. WPWebViewActivity's "open in external browser" used mWebView.getUrl(), which is null until the first page load completes; it now falls back to the URL_TO_LOAD extra, so the button works before load instead of no-opping. The openUrl guard itself is left in place as a safety net for other callers.

Testing steps

  1. Open a comment whose author has no website set. Confirm the author name/avatar is not clickable and tapping it does nothing (no READER warning in logcat).
  2. Open a comment whose author does have a website. Confirm tapping the name/avatar still opens their blog.
  3. Open any in-app web view (e.g. a Reader post link) and tap "Open in external browser" immediately, before the page finishes loading. Confirm it opens the correct url in the browser rather than doing nothing.
  4. Repeat step 3 after the page has fully loaded to confirm no regression.

ReaderActivityLauncher.openUrl() guards null/empty urls by reporting to
Sentry and returning, so these two issues are handled reports rather than
crashes. The root cause is two call sites passing empty urls, which also
left the user with a button that silently does nothing.

CommentDetailFragment only checked getAuthorUrl() != null, so an empty
author url still wired up a dead click listener. WPWebViewActivity's
"open in external browser" used mWebView.getUrl(), which is null until
the first page load finishes; it now falls back to the URL_TO_LOAD extra.

Fixes JETPACK-ANDROID-1G9S
Fixes JETPACK-ANDROID-1J82
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr23147-e909423
Build Number1498
Application IDcom.jetpack.android.prealpha
Commite909423
Installation URL6a6q3s9far5s8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr23147-e909423
Build Number1498
Application IDorg.wordpress.android.prealpha
Commite909423
Installation URL5mpurl6q6fu70
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@nbradbury

Copy link
Copy Markdown
Contributor Author

Closing this because neither is a crash. No data loss, no dead-end state.

@nbradbury nbradbury closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants