Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cache bust jsr deps on constraint failure #22372

Merged

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Feb 10, 2024

Removes the FileFetcher's internal cache because I don't believe it's necessary (we already cache this kind of stuff in places like deno_graph or config files in different places). Removing it fixes this bug because this functionality was already implemented in deno_graph and lowers memory usage of the CLI a little bit.

@@ -1,4 +1,5 @@
Download http://127.0.0.1:4250/@denotest/deps/meta.json
Download http://127.0.0.1:4250/@denotest/deps/meta.json
error: Could not find constraint in the list of versions: @denotest/deps@0.1.4
Specifier: jsr:@denotest/deps@0.1.4/mod.ts
at file:///[WILDCARD]/version_not_found/main.ts:1:19
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very minor issue is now we request the metadata twice even if the metadata was not originally loaded from the cache. Fixing this would require telling deno_graph about if a specifier was loaded from the cache or not, which I think would be too much complexity and isn't worth fixing.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dsherret dsherret merged commit d2477f7 into denoland:main Feb 10, 2024
17 checks passed
@dsherret dsherret deleted the fix_cache_bust_jsr_deps_on_constraint_failure branch February 10, 2024 15:02
littledivy pushed a commit that referenced this pull request Feb 15, 2024
Removes the `FileFetcher`'s internal cache because I don't believe it's
necessary (we already cache this kind of stuff in places like deno_graph
or config files in different places). Removing it fixes this bug because
this functionality was already implemented in deno_graph and lowers
memory usage of the CLI a little bit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants