-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(core): prevent hangs due to degenerate lockfile diff #4453
Conversation
That looks good to me, thanks! Until the package is properly released we can try using it with a git protocol (cc @kpdecker) |
dc412d8
to
e669215
Compare
FWIW @arcanis I'm not sure git protocol ("diff": "git@github.com:kpdecker/jsdiff.git" |
e669215
to
fea0dcb
Compare
I think we can just upgrade to the newly published 5.1! Although as a trivia, Yarn runs the |
5458029
to
5af761b
Compare
I don't know 100% that the build will go green, but the one failing job seemingly has nothing to do with my PR - a typescript package's checksum has begun failing. I experimentally freshened it using the latest from npmjs.org -- hopefully this isn't some obscure supply chain attack! |
The only difference between the two is that one is better compressed than the other, otherwise their content is identical. Same thing happens on |
Hm perhaps you installed TS 4.7 in a project which had a compression set to However this shouldn't be possible because we append a cache key to the global path, and the compression level is part of it 🤔 |
Yeah, that shouldn't be possible, besides the size difference isn't enough for that to be the case. -11 652 885 bytes
+11 654 629 bytes |
* Upgrade diff to 5.0.0 * Add maxEditLength to lockfile patch. Fixes #4405. * Prepare fix for release * Upgrade diff to 5.1.0 * Re-resolve typescript 4.7.0-beta from npmjs.org * chore: versions Co-authored-by: Tony Spataro <anthony.spataro@appfolio.com> Co-authored-by: merceyz <merceyz@users.noreply.github.com>
What's the problem this PR addresses?
This limits the max edit length for jsdiff, keeping it from taking "forever" with very large lockfiles that have substantial changes. It keeps
yarn install --immutable
from hanging when the prior lockfile was substantially different from the computed lockfile, and thereby fixes #4405....
How did you fix it?
The fix relies on a new
maxEditLength
option for jsdiff, which is available in jsdiff@5.1.0.If the max edit length is exceeded, jsdiff returns
undefined
andProject.ts
simply skips the verbose diff output....
Checklist
I have read the Contributing Guide.
I have set the packages that need to be released for my changes to be effective.
I will check that all automated PR checks pass before the PR gets reviewed.