Skip to content

Conversation

@d4rken
Copy link
Member

@d4rken d4rken commented Jul 21, 2025

The UpgradeRepo could throw an error which would people up (after 7 days grace period) and hit the app-level coroutine scope, which could crash the app.

Let's catch that error, default to "isPro=false", and if the user visits the upgrade screen, show error specifics.

The UpgradeRepo could throw an error which would people up (after 7 days grace period) and hit the app-level coroutine scope, which could crash the app.

Let's catch that error, default to "isPro=false", and if the user visits the upgrade screen, show error specifics.
@d4rken d4rken added bug Something isn't working as expected Google Play labels Jul 21, 2025
d4rken added 5 commits July 21, 2025 19:39
This commit introduces a retry mechanism with exponential backoff for fetching upgrade information. If there's an error and the last pro state was recent (within 7 days), it enters a grace period and emits cached data. Otherwise, it emits an error.
This change introduces a flag to ensure that an error message on the upgrade screen is only shown once to the user, even if the underlying error state persists across configuration changes or other lifecycle events.
This commit refactors the error handling logic in the `UpgradeViewModel` for both Gplay and FOSS versions. It extracts the error object into a local variable before using it, improving code readability.

Smartcast issue:

> Expected non-nullable value [NullSafeMutableLiveData from androidx.lifecycle]
This commit resolves a linter warning related to unnecessary null assertions in both the gplay and foss variants of `UpgradeViewModel`. The warning was suppressed as it was identified as a linter bug.
@d4rken d4rken merged commit 0f1d8a4 into main Jul 23, 2025
16 checks passed
@d4rken d4rken deleted the gplay-errorhandling branch July 23, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected Google Play

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants