Naomizheng/fix stale npm cache bug#530
Merged
danfiedler-msft merged 7 commits intomicrosoft:mainfrom Apr 8, 2026
Merged
Conversation
…aomizhengmsft/OSSGadget into naomizheng/fixStaleNPMCacheBug
michelleqyun
approved these changes
Mar 26, 2026
morended
approved these changes
Apr 2, 2026
Member
Author
|
/azp run |
|
No pipelines are associated with this pull request. |
Member
|
/azp run |
|
Commenter does not have sufficient privileges for PR 530 in repo microsoft/OSSGadget |
Contributor
|
/azp run |
|
No pipelines are associated with this pull request. |
Contributor
|
/azp run |
|
No pipelines are associated with this pull request. |
pmalmsten
reviewed
Apr 8, 2026
Comment on lines
+614
to
+615
| DataCache.Remove($"{cacheUrl}/json"); | ||
| jsonDoc = await GetJsonCache(client, cacheUrl, useCache: false); |
Contributor
There was a problem hiding this comment.
@naomizhengmsft I'm a bit late to this PR, but this line states useCache: false. Isn't that redundant with DataCache.Remove($"{cacheUrl}/json"); above? Would we be fine if this second call to GetJsonCache updated the cache again with a fresh value (since we just explicitly evicted any prior value there)?
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.
NPM needs to fetch package entire metadata and stores it in the cache. Previously if the package we are trying to fetch exist in the cache, we would then assume it would have the version we need but the data in the cache could be stale especially if the new package was published within 30 minutes of the initial cache store so we should try to refetch the data or else we would return back null.