Conversation
When a just-upgraded-from marker persists across sessions, the update check would write UP_TO_DATE to cache and exit immediately — never fetching the remote VERSION. Users silently miss updates that landed after their last upgrade. Remove the early exit and premature cache write so the script falls through to the remote check after consuming the marker. This ensures JUST_UPGRADED is still emitted for the preamble, while also detecting any newer versions available upstream. Fixes garrytan#515
3 tasks done
Contributor
Author
|
Merged via #552. Closing. |
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.
Problem
When a
just-upgraded-frommarker file persists across sessions,gstack-update-checkshort-circuits at Step 2 (line 112–122) — it writesUP_TO_DATEto cache and exits immediately, never fetching the remote VERSION. Users silently stay on old versions, potentially missing dozens of commits.Reported in #515: a user upgraded from 0.9.3.0 → 0.9.4.0, then missed 42 commits because the marker caused Step 4 (remote fetch) to be skipped entirely.
Root cause
The script assumes "just upgraded = up to date", which isn't true if the remote advanced between the upgrade and the next session.
Fix
Remove the
exit 0and the prematureUP_TO_DATEcache write. The script now:JUST_UPGRADEDfor the preamble (same as before)If no further updates exist, Step 4 writes
UP_TO_DATEto cache as normal. If a newer version landed, the user sees bothJUST_UPGRADEDandUPGRADE_AVAILABLEin the same session.Changes
bin/gstack-update-check— remove early exit and premature cache write from Step 2 (+2/−3 lines)browse/test/gstack-update-check.test.ts— add two regression tests:UPGRADE_AVAILABLEJUST_UPGRADED, cache reflectsUP_TO_DATETest plan
bun test browse/test/gstack-update-check.test.ts)bun testpasses (only pre-existing bug: package.json version out of sync with VERSION file on main #399 version mismatch fails — unrelated)UP_TO_DATEon unreachable remote)Fixes #515