Fix isTooSoon to reset when a newer app store version is available - #551
Merged
Conversation
Agent-Logs-Url: https://github.com/larryaasen/upgrader/sessions/4f5a4c45-bc13-481a-b561-6be28999a14f Co-authored-by: larryaasen <325973+larryaasen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Upgrader.isTooSoon logic to compare _lastVersionAlerted
Fix isTooSoon to reset when a newer app store version is available
May 21, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #551 +/- ##
==========================================
+ Coverage 91.95% 92.12% +0.16%
==========================================
Files 12 12
Lines 1317 1320 +3
==========================================
+ Hits 1211 1216 +5
+ Misses 106 104 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the Upgrader.isTooSoon() suppression logic so that the “alert again” time gate is bypassed when the available store version has changed since the last alert, preventing a newer store version prompt from being silently suppressed within the cooldown window.
Changes:
- Updated
isTooSoon()to immediately returnfalsewhenversionInfo.appStoreVersiondiffers from_lastVersionAlerted. - Added unit tests to verify
isTooSoon()returnsfalsefor a newer store version and remainstruefor the same store version within the cooldown window.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/src/upgrader.dart | Adds a version-difference check to bypass the cooldown when the store version changes. |
| test/upgrader_test.dart | Adds regression tests covering the new isTooSoon() branch for changed vs unchanged store versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
larryaasen
added a commit
that referenced
this pull request
May 24, 2026
* 'main' of https://github.com/larryaasen/upgrader: Fix isTooSoon to reset when a newer app store version is available (#551)
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.
isTooSoon()only checked elapsed time since the last alert, ignoring_lastVersionAlerted. If a user tapped "Later" on v1.0.1 and the store updated to v1.0.2 before thedurationUntilAlertAgainwindow elapsed, the v1.0.2 alert would be silently suppressed.Changes
lib/src/upgrader.dart: Added a version check inisTooSoon()— returnsfalseimmediately when the current app store version differs from_lastVersionAlerted, bypassing the time gate for genuinely new versions.test/upgrader_test.dart: Two new unit tests covering the new branch — one assertingfalsewhen the store version advances past the alerted version, one assertingtrueis preserved when the version is unchanged and within the alert window.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dl.google.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https(dns block)https://storage.googleapis.com/flutter_infra_release/flutter/4c525dac5ebe5971c5708ef73558ed8edcf4a362/dart-sdk-linux-x64.zip/usr/bin/curl curl --retry 3 --continue-at - --location --output /tmp/flutter-git/bin/cache/dart-sdk-linux-x64.zip REDACTED(http block)https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json/snap/flutter/current/usr/bin/curl curl -o releases_linux.json REDACTED(http block)https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.19.5-stable.tar.xz/usr/bin/curl curl -L REDACTED -o flutter.tar.xz(http block)https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.0-stable.tar.xz/usr/bin/curl curl -L REDACTED -o flutter.tar.xz(http block)If you need me to access, download, or install something from one of these locations, you can either: