Skip to content
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

Ensure the correct error message is shown when failing to open a Uri in paywalls #1922

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

JayShortway
Copy link
Member

Quick follow-up to #1904.

Motivation

We have 2 error cases when opening Uris:

  • "Link is invalid"
  • "No browser installed"

However, if the app includes a more recent version of Compose, UriHandler throws the same exception (IllegalArgumentException) for both of these cases (source), which means we never actually show the "No browser installed" error message.

This PR fixes that by no longer relying on UriHandler, and implementing the (very simple) logic ourselves. I think this is justified, as we cannot know which version of UriHandler we get at runtime.

@JayShortway JayShortway requested a review from a team November 19, 2024 12:26
@JayShortway JayShortway self-assigned this Nov 19, 2024
Copy link

emerge-tools bot commented Nov 19, 2024

📸 Snapshot Test

74 unchanged

Name Added Removed Modified Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
0 0 0 74 0 N/A

🛸 Powered by Emerge Tools

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.17%. Comparing base (46a9e0e) to head (b6c7bd2).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1922   +/-   ##
=======================================
  Coverage   82.17%   82.17%           
=======================================
  Files         232      232           
  Lines        8101     8101           
  Branches     1146     1146           
=======================================
  Hits         6657     6657           
  Misses        991      991           
  Partials      453      453           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@JayShortway JayShortway requested a review from vegaro November 19, 2024 16:20
@JayShortway
Copy link
Member Author

@vegaro I requested re-review as my last commit changed some stuff around again.

@JayShortway JayShortway merged commit 84a333e into main Nov 25, 2024
12 checks passed
@JayShortway JayShortway deleted the openuriorelse-v3 branch November 25, 2024 09:12
This was referenced Nov 28, 2024
JayShortway pushed a commit that referenced this pull request Dec 2, 2024
**This is an automatic release.**

## RevenueCat SDK
### 🐞 Bugfixes
* Uses `Sequence` instead of `Stream` to avoid errors due to unavailable
Java 8 APIs (#1943) via JayShortway (@JayShortway)

### 🔄 Other Changes
* Increase integration test timeout (#1946) via Toni Rico (@tonidero)
* Removes `@RequiresApi(N)` from `FileHelper` and related classes
(#1944) via JayShortway (@JayShortway)
* [Paywalls V2] Minimizes Java API (#1942) via JayShortway
(@JayShortway)
* [Paywalls V2] Makes `TextComponent` public (#1939) via JayShortway
(@JayShortway)
* Introduces an `@InternalRevenueCatAPI` annotation (#1938) via
JayShortway (@JayShortway)
* [Paywalls V2] Moves any non-component file to a new `common` package.
(#1937) via JayShortway (@JayShortway)
* [Paywalls V2] `LocalizationKey` is an inline value class now. (#1936)
via JayShortway (@JayShortway)
* [Paywalls V2] Adds `PaywallComponentsData` (#1935) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `StickyFooterComponent` (#1934) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `PurchaseButtonComponent` (#1933) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `PackageComponent` (#1932) via JayShortway
(@JayShortway)
* Ensure the correct error message is shown when failing to open a Uri
in paywalls (#1922) via JayShortway (@JayShortway)
* [Paywalls V2] Adds `ButtonComponent` (#1931) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `StackComponent` (#1930) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `ComponentOverrides` (#1929) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `ImageComponent` (#1928) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `TextComponent` (#1927) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds all enum properties (#1926) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `SizeConstraints`, `Size`, `Padding` and `Shadow`
properties (#1925) via JayShortway (@JayShortway)
* [Paywalls V2] Adds `CornerRadiuses`, `Shape` and `MaskShape`
properties (#1924) via JayShortway (@JayShortway)
* [Paywalls V2] Adds `ImageUrls` and `ColorInfo` properties (#1923) via
JayShortway (@JayShortway)

Co-authored-by: revenuecat-ops <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants