Avoid repeated preindexed source refreshes#35
Merged
Gabriel Dufresne (GabrielDuf) merged 3 commits intoJun 2, 2026
Merged
Conversation
Use the freshest available source metadata or index.db timestamp when deciding whether a preindexed source cache is stale. Add C# and Rust regression coverage for stale metadata with a fresh index and clean up Rust temporary index files when replacement fails. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Set the default preindexed source auto-update interval to 15 minutes to match winget-cli's source.autoUpdateIntervalInMinutes default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Gabriel Dufresne (GabrielDuf)
previously approved these changes
Jun 2, 2026
Run scripts/Set-PingetVersion.ps1 0.8.2 to update Rust, C#, PowerShell, and NuGet package version surfaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Gabriel Dufresne (GabrielDuf)
approved these changes
Jun 2, 2026
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.
Summary
index.dbtimestamp when deciding whether a preindexed cache is stale.scripts\Set-PingetVersion.ps1 0.8.2.WinGet comparison
WinGet checks source freshness before opening sources. For preindexed sources, it refreshes when there is no usable cached source package, or when the later of the cached source package version timestamp and source metadata
LastUpdateTimeis older thansource.autoUpdateIntervalInMinutes. The default for that setting is 15 minutes;0disables auto-update. It also honorsDoNotUpdateBeforeto avoid retrying too soon after service throttling.Pinget now mirrors the same practical behavior for its direct
index.dbcache: it refreshes whenindex.dbis missing, or when the freshest available timestamp (LastUpdatemetadata orindex.dbmtime) is older than the configured interval. Explicit source updates and explicit missing-version recovery can still force a refresh.Benchmark
Final isolated
pinget show Microsoft.PowerToysRelease timing:Validation
dotnet test dotnet\src\Devolutions.Pinget.Core.Tests\Devolutions.Pinget.Core.Tests.csproj -c Release --nologocargo test -p pinget-core --manifest-path rust\Cargo.tomlcargo clippy -q --manifest-path rust\Cargo.toml --workspace --tests -- -D warningscargo build -p pinget-cli --manifest-path rust\Cargo.toml --releasedotnet test dotnet\src\Devolutions.Pinget.Core.Tests\Devolutions.Pinget.Core.Tests.csproj -c Release --filter "FullyQualifiedName~Show_PreindexedFreshIndexMtime|FullyQualifiedName~Show_PreindexedStaleIndex|FullyQualifiedName~Show_PreindexedExplicitMissingVersion|FullyQualifiedName~Show_PreindexedStaleIndex_WhenRefreshFails" --nologocargo test -p pinget-core --manifest-path rust\Cargo.toml preindexed_cargo test -p pinget-core --manifest-path rust\Cargo.toml repository_options_capture_custom_host_settingsdotnet build dotnet\Devolutions.Pinget.slnx -c Release --nologocargo build -p pinget-cli --manifest-path rust\Cargo.tomlcargo build -p pinget-com --manifest-path rust\Cargo.toml