Skip to content

Use different folders with integrity or without#7586

Merged
arcanis merged 6 commits intomasterfrom
mael/integrity-cache-split
Sep 30, 2019
Merged

Use different folders with integrity or without#7586
arcanis merged 6 commits intomasterfrom
mael/integrity-cache-split

Conversation

@arcanis
Copy link
Copy Markdown
Member

@arcanis arcanis commented Sep 30, 2019

Summary

When installing a package, Yarn used to always store it based on it's old sha1 checksum. To prevent cache injection issues, we started checking that the cache was in a consistent state before installing it. Unfortunately, it means that various errors are reported when packages got installed without integrity fields and later need to be installed with an integrity field.

This diff fixes that by using different folders for those two use cases. It's slightly worse for performances (since some packages will be downloaded twice in this very specific situation), but much better from a UX perspective.

Note that the real fix will come with the v2, since the cache system will be completely different and won't suffer from this kind of problems.

Fix #7584

Test plan

Tested locally.

@arcanis arcanis merged commit 25d5526 into master Sep 30, 2019
arcanis added a commit that referenced this pull request Oct 8, 2019
* Uses a different folder for pkgs with integrity or without

* Fixes for when integrity is an object instance

* Stores whether integrity exists or not

* Updates a lockfile to reference the integrity

* Fixes resolver check

* Fixes cache pattern
VincentBailly pushed a commit to VincentBailly/yarn that referenced this pull request Jun 10, 2020
* Uses a different folder for pkgs with integrity or without

* Fixes for when integrity is an object instance

* Stores whether integrity exists or not

* Updates a lockfile to reference the integrity

* Fixes resolver check

* Fixes cache pattern
VincentBailly pushed a commit to VincentBailly/yarn that referenced this pull request Jun 10, 2020
* Uses a different folder for pkgs with integrity or without

* Fixes for when integrity is an object instance

* Stores whether integrity exists or not

* Updates a lockfile to reference the integrity

* Fixes resolver check

* Fixes cache pattern
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.

"Incorrect integrity when fetching from the cache"

1 participant