Force a live outdated recompute when the Packages pane Refresh button is clicked#14918
Open
juliasilge wants to merge 2 commits into
Open
Force a live outdated recompute when the Packages pane Refresh button is clicked#14918juliasilge wants to merge 2 commits into
juliasilge wants to merge 2 commits into
Conversation
|
E2E Tests 🚀 Why these tags?
More on automatic tags from changed files. |
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.
Addresses to #14294 (together with posit-dev/ark#1351)
The Packages pane persists outdated-package state to an on-disk cache so update indicators can render immediately on a warm start. The toolbar Refresh button reused that cache so that within the freshness window (default 24h) it re-rendered the cached indicators instead of recomputing, so an explicit Refresh could keep showing stale "outdated" flags that no longer matched the environment. Only the less-discoverable "Refresh Metadata" command forced a live recompute.
This makes the user-initiated Refresh authoritative. It now always recomputes outdated state live for every package, bypassing the freshness window, while automatic warm-start refreshes (on session attach) keep using the fast cached path. A forced recompute overwrites stale
outdated: trueentries with the current result, so clicking Refresh reliably clears indicators that no longer apply.This is the Positron half of #14294. The complementary Ark change (posit-dev/ark#1351) stops
pkg_outdatedfrom flagging same-version packages that were merely rebuilt under a new R minor, which was the original trigger for the inflated counts.Release Notes
New Features
Bug Fixes
Validation Steps
@:packages-pane
The bug only surfaces when the cache disagrees with reality while installed versions stay fixed, so the reliable way to exercise it is to change the configured repositories (the cache is keyed on the interpreter, not the repos) and confirm the pane tracks a live
old.packages()after Refresh. It's pretty fiddly!Start an R session and point at a snapshot recent enough that most installed packages are current:
Open the Packages pane, click the Refresh button, and note the outdated count. Confirm it matches ground truth from the console:
Without reinstalling anything, point at an older dated snapshot so some installed versions are now behind:
Click Refresh again. The pane's outdated indicators should update to match the new
nrow(old.packages()), even though only the repos changed. Before this fix, within the freshness window the pane would keep showing the step-2 result from the cache.The Python equivalent is the same shape: install a package pinned below its latest version (
pip install "requests<2.31"), Refresh so the pane caches it as outdated, upgrade it in the console (pip install -U requests), and confirm Refresh clears the indicator to matchpip list --outdated.