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

When the app shows UpgradeAlert, kill the app without clicking any button, and will not show UpgradeAlert when the app is opened again #444

Open
dylan-huang-1024 opened this issue Sep 6, 2024 · 3 comments
Labels
How To? This is a how to question

Comments

@dylan-huang-1024
Copy link

hi,
When using the upgrader: ^10.3.0, I encountered such a scene. I don't know if it is a bug or a normal behavior.
Please give your opinion, thanks.

[reproduce step]:

  1. open the app and show UpgradeAlert correctly
  2. without clicking any button, just kill the app
  3. reopen the app, cannot show UpgradeAlert again
  4. but can show UpgradeAlert after durationUntilAlertAgain.

remark: just like the behavior that I clicked the [Later] button
[expected result]:
step3: should show UpgradeAlert again

other infomations:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.2, on Microsoft Windows [版本 10.0.22631.4112], locale zh-CN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2023.3)
[√] IntelliJ IDEA Community Edition (version 2024.1)
[√] VS Code (version unknown)
X Unable to determine VS Code version.
[√] Connected device (4 available)
[!] Network resources
X A network error occurred while checking "https://maven.google.com/": 信号灯超时时间已到

! Doctor found issues in 2 categories.

logs:
I/flutter (10284): upgrader: instantiated
I/flutter (10284): upgrader: initialize called
I/flutter (10284): upgrader: initializing
I/flutter (10284): upgrader: operatingSystem: android, version: sdk_gphone64_x86_64-userdebug 14 UE1A.230829.036.A2 11596452 dev-keys
I/flutter (10284): upgrader: packageInfo packageName: xxx
I/flutter (10284): upgrader: packageInfo appName: XXX
I/flutter (10284): upgrader: packageInfo version: 1.2.10
I/flutter (10284): upgrader: current locale: en_US
I/flutter (10284): upgrader: countryCode: US
I/flutter (10284): upgrader: languageCode: en
I/flutter (10284): upgrader: UpgraderAppStore: version info: appStoreListingURL: xxx, appStoreVersion: 1.2.56, installedVersion: 1.2.10, isCriticalUpdate: false, minAppVersion: 1.2.9, releaseNotes: null
I/flutter (10284): upgrader: initialize called
I/flutter (10284): upgrader: build UpgradeAlert
I/flutter (10284): upgrader: need to evaluate version
I/flutter (10284): upgrader: blocked: false
I/flutter (10284): upgrader: debugDisplayAlways: false
I/flutter (10284): upgrader: debugDisplayOnce: false
I/flutter (10284): upgrader: hasAlerted: false
I/flutter (10284): upgrader: installedVersion: 1.2.10
I/flutter (10284): upgrader: minAppVersion: null
I/flutter (10284): upgrader: isUpdateAvailable: true
I/flutter (10284): upgrader: isTooSoon: true
I/flutter (10284): upgrader: shouldDisplayUpgrade: false
I/flutter (10284): upgrader: shouldDisplayReleaseNotes: false
I/flutter (10284): upgrader: initialize called
I/flutter (10284): upgrader: build UpgradeAlert
I/flutter (10284): upgrader: need to evaluate version
I/flutter (10284): upgrader: blocked: false
I/flutter (10284): upgrader: debugDisplayAlways: false
I/flutter (10284): upgrader: debugDisplayOnce: false
I/flutter (10284): upgrader: hasAlerted: false
I/flutter (10284): upgrader: installedVersion: 1.2.10
I/flutter (10284): upgrader: minAppVersion: null
I/flutter (10284): upgrader: isUpdateAvailable: true
I/flutter (10284): upgrader: isTooSoon: true
I/flutter (10284): upgrader: shouldDisplayUpgrade: false
I/flutter (10284): upgrader: shouldDisplayReleaseNotes: false
I/flutter (10284): upgrader: build UpgradeAlert
I/flutter (10284): upgrader: need to evaluate version
I/flutter (10284): upgrader: blocked: false
I/flutter (10284): upgrader: debugDisplayAlways: false
I/flutter (10284): upgrader: debugDisplayOnce: false
I/flutter (10284): upgrader: hasAlerted: false
I/flutter (10284): upgrader: installedVersion: 1.2.10
I/flutter (10284): upgrader: minAppVersion: null
I/flutter (10284): upgrader: isUpdateAvailable: true
I/flutter (10284): upgrader: isTooSoon: true
I/flutter (10284): upgrader: shouldDisplayUpgrade: false
I/flutter (10284): upgrader: shouldDisplayReleaseNotes: false
I/flutter (10284): upgrader: initialize called
I/flutter (10284): upgrader: build UpgradeAlert
I/flutter (10284): upgrader: need to evaluate version
I/flutter (10284): upgrader: blocked: false
I/flutter (10284): upgrader: debugDisplayAlways: false
I/flutter (10284): upgrader: debugDisplayOnce: false
I/flutter (10284): upgrader: hasAlerted: false
I/flutter (10284): upgrader: installedVersion: 1.2.10
I/flutter (10284): upgrader: minAppVersion: null
I/flutter (10284): upgrader: isUpdateAvailable: true
I/flutter (10284): upgrader: isTooSoon: true
I/flutter (10284): upgrader: shouldDisplayUpgrade: false
I/flutter (10284): upgrader: shouldDisplayReleaseNotes: false
I/flutter (10284): upgrader: build UpgradeAlert
I/flutter (10284): upgrader: need to evaluate version
I/flutter (10284): upgrader: blocked: false
I/flutter (10284): upgrader: debugDisplayAlways: false
I/flutter (10284): upgrader: debugDisplayOnce: false
I/flutter (10284): upgrader: hasAlerted: false
I/flutter (10284): upgrader: installedVersion: 1.2.10
I/flutter (10284): upgrader: minAppVersion: null
I/flutter (10284): upgrader: isUpdateAvailable: true
I/flutter (10284): upgrader: isTooSoon: true
I/flutter (10284): upgrader: shouldDisplayUpgrade: false
I/flutter (10284): upgrader: shouldDisplayReleaseNotes: false
I/flutter (10284): upgrader: initialize called
I/flutter (10284): upgrader: build UpgradeAlert
I/flutter (10284): upgrader: need to evaluate version
I/flutter (10284): upgrader: blocked: false
I/flutter (10284): upgrader: debugDisplayAlways: false
I/flutter (10284): upgrader: debugDisplayOnce: false
I/flutter (10284): upgrader: hasAlerted: false
I/flutter (10284): upgrader: installedVersion: 1.2.10
I/flutter (10284): upgrader: minAppVersion: null
I/flutter (10284): upgrader: isUpdateAvailable: true
I/flutter (10284): upgrader: isTooSoon: true
I/flutter (10284): upgrader: shouldDisplayUpgrade: false
I/flutter (10284): upgrader: shouldDisplayReleaseNotes: false
I/flutter (10284): upgrader: build UpgradeAlert
I/flutter (10284): upgrader: need to evaluate version
I/flutter (10284): upgrader: blocked: false
I/flutter (10284): upgrader: debugDisplayAlways: false
I/flutter (10284): upgrader: debugDisplayOnce: false
I/flutter (10284): upgrader: hasAlerted: false
I/flutter (10284): upgrader: installedVersion: 1.2.10
I/flutter (10284): upgrader: minAppVersion: null
I/flutter (10284): upgrader: isUpdateAvailable: true
I/flutter (10284): upgrader: isTooSoon: true
I/flutter (10284): upgrader: shouldDisplayUpgrade: false
I/flutter (10284): upgrader: shouldDisplayReleaseNotes: false

@Kaizodo
Copy link

Kaizodo commented Sep 9, 2024

#426 Possible duplicate and a solution as well hope someone will create a pr for this.

@phamgiaminh0112
Copy link

I have corrected this error and created a pull request. In that you just need to remove the isTooSoon() condition in file src/upgrader.dart line number 306. And don't forget to set showIgnore = false and showLater = false if you don't want users to skip the update.

@larryaasen
Copy link
Owner

There is a parameter on Upgrader called durationUntilAlertAgain which is set to const Duration(days: 3) (3 days) by default. That is what causes isTooSoon to be true. This is designed to prevent the alert from annoying a user with prompts over and over repeatedly. If you do not like that behavior, change durationUntilAlertAgain to a shorter duration.

@larryaasen larryaasen added the How To? This is a how to question label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
How To? This is a how to question
Projects
None yet
Development

No branches or pull requests

4 participants