feat(inquirerer-utils): add suppressUpdateCheck to write cache entry after update#65
Merged
pyramation merged 1 commit intomainfrom Feb 27, 2026
Merged
Conversation
…after update After a CLI update command installs a new version, the currently running binary still reports the old version. If we merely clear the cache, the next command fetches the latest from npm and compares against the stale pkgVersion, producing a false-positive 'Update available' message. suppressUpdateCheck writes the current binary's version as latestVersion so the next checkForUpdates call sees no update needed. The cache expires after 24h, at which point a fresh check runs against the new binary.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Merged
3 tasks
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.
feat(inquirerer-utils): add suppressUpdateCheck for post-update cache
Summary
Adds a new exported function
suppressUpdateCheck(toolName, currentVersion)to@inquirerer/utils, alongside the existingclearUpdateCache.Problem: After a CLI
updatecommand (e.g.pgpm update) installs a new version,clearUpdateCachedeletes the cache file. The next CLI invocation — still running under the old binary due to process/shim timing — finds no cache, fetches the latest version from npm, compares it against the stalepkgVersion, and shows a false-positive "Update available" message.Solution:
suppressUpdateCheckwrites a cache entry withlatestVersionset to the current binary's version. The nextcheckForUpdatescall seeslatestVersion === pkgVersion→hasUpdate: false. The cache expires after 24h, at which point a fresh check runs against the (by then correct) new binary.This is a companion to constructive#749 which updates the pgpm
updatecommand to callsuppressUpdateCheckinstead ofclearUpdateCache.Review & Testing Checklist for Human
suppressUpdateCheckwrites{ latestVersion, timestamp }— the same internal format thatcheckForUpdatesreads (lines 137-138 ofupdate-check.ts). Verify this stays consistent. Both are in the same file, but worth confirming.clearUpdateCache, which re-exposes the original bug (false-positive update message). Confirm this is acceptable as a best-effort fallback vs. silently failing.--passWithNoTests). Consider whether a test for this function is needed before merging, especially to lock in the cache format contract.Notes