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

Catch more generic exceptions for InstallReferrer (close #647) #681

Merged
merged 6 commits into from
Apr 5, 2024

Conversation

mscwilson
Copy link
Contributor

@mscwilson mscwilson commented Mar 28, 2024

For issue #647

The InstallReferrerDetails class currently checks whether the InstallReferrer dependency is present or not, but if it is, then only catches RemoteExceptions. InstallReferrer below v1.1 doesn't have the googlePlayInstantParam property which causes a NoSuchMethodError.

Unfortunately the googlePlayInstantParam is the one required property for the referrer_details schema, so if InstallReferrer v1.0 is used it's not possible to add the entity at all.

This change catches the NoSuchMethodError.

@mscwilson mscwilson requested a review from matus-tomlein March 28, 2024 10:57
Copy link
Contributor

@matus-tomlein matus-tomlein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@VenomVendor
Copy link

As the code will always crash without the dependency, why was the decision to catch Exception instead of updating transitive dependencies?.

Can this PR also update about the missing info in the doc

@mscwilson
Copy link
Contributor Author

Hi @VenomVendor good shout about the docs!

I don't understand the first part of your message sorry. The code already caught when the dependency is completely absent, now it will also catch versions without the required functionality.

@VenomVendor
Copy link

I meant, why to catch the exception if we can update transitive dependency.
Here, we're using compileOnly, instead if we could update to implementation. This exception handling can be removed, as the library with specific version will be bundled.

I was in an assumption that the dependency install-referrer is mandatory. Found this check isInstallReferrerPackageAvailable().

@mscwilson mscwilson merged commit 55f5656 into release/6.0.3 Apr 5, 2024
3 checks passed
@mscwilson mscwilson deleted the bug/installreferrer_missing_method branch April 5, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants