-
Notifications
You must be signed in to change notification settings - Fork 131
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
[Authenticated WebView] Fix a crash related to using URLs without a scheme #13661
[Authenticated WebView] Fix a crash related to using URLs without a scheme #13661
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release/21.8 #13661 +/- ##
===============================================
Coverage 38.08% 38.08%
- Complexity 9043 9044 +1
===============================================
Files 2057 2057
Lines 112562 112563 +1
Branches 14252 14252
===============================================
+ Hits 42871 42872 +1
Misses 65791 65791
Partials 3900 3900 ☔ View full report in Codecov by Sentry. |
@hichamboushaba, I noticed that the default value of I tested Tested with Sentry error: I suspect the issue might be an empty |
This is an even better solution, thanks! Can we still add an empty string check to |
Good point @irfano, but let me know what you think of my opinion before we implement it: I think it's up to the consumers to confirm they are passing non-empty URLs here, and the crash when they don't is better than having a non-ideal experience. For example in this occasion, the crash heped us idenfiy an issue that was happening for a long time where the app would open the browser using an empty URL. |
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.
It makes sense! Thanks for explaining.
Let's go with merging this. LGTM! 👍🏻
Closes: #13660
Description
This PR fixes a crash in one of the Authenticated WebView components when passing a URL without a scheme.
Steps to reproduce
permalink
field without a scheme.Testing information
The tests that have been performed
I tested just using the unit test, I think it should be enough.
I have considered if this change warrants release notes and have added them to
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: