Repository navigation
fix(appupdates): recheck the forced update when the minimum version changes - #1802
Merged
Merged
Conversation
…hanges The forced-update check on resume reads the minimum version cached from the last flag fetch. The fetch that runs on the same resume lands after the check has passed, so a minimum raised while the app was backgrounded only blocked the app on the next cold start. The controller now runs the check again whenever the minimum version changes. It skips the first value so building the controller does not check on its own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A minimum version raised while the app is in the background doesn't block the app when it comes back, only on the next cold start.
Both update checks already run on every resume. The forced check compares against the minimum version cached from the last flag fetch, and the fetch started by that same resume (
RealSessionController.onAppInForeground) finishes after the check has already passed. Nothing ran the check again.GooglePlayAppUpdateControllernow watchesminimumVersion.effectiveValueand runscheckForUpdate()when it changes. It drops the first value, so creating the controller doesn't add a check the resume hook isn't already making.ForcedUpdateTestgets two cases: raising the minimum after a check shows the gate, and creating the controller checks nothing on its own. The first fails without the change.