-
Couldn't load subscription status.
- Fork 3.8k
fix(arborist): improve override conflict detection with semantic comparison #8689
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
base: latest
Are you sure you want to change the base?
Conversation
The override conflict detection added in b9225e5 is overly conservative and produces false positives in two scenarios: 1. Peer dependencies: These resolve to nodes in different parts of the tree with legitimately different override contexts. 2. Reference overrides ($syntax): Different override sets using references (e.g., $@vaadin/react-components vs $@vaadin/react-components-pro) are structurally different but functionally equivalent when they resolve to the same versions. This fix removes the override conflict check entirely from edge validation. The check was redundant because: - Version satisfaction is already validated by satisfiedBy() - Any actual version conflicts in dependencies are caught during normal dependency resolution in the build/reify phase - The check caused false positives that prevented valid dependency configurations from working Fixes: npm#8688
…ation because it caused false positives with reference overrides ($syntax) that resolve to functionally equivalent versions. Real conflicts are caught during the build/reify phase. See issue npm#8688 and the fix in edge.js
Replace the test 'should find inconsistency between the edge's override set and the target's override set' which was testing the override conflict detection code that was intentionally removed. The new test 'edges with different override contexts to same node should be valid' is a regression test for issue npm#8688. It verifies that edges remain valid when the edge and target node have different override contexts, as long as the version requirements are satisfied. The override conflict check (from b9225e5) was causing false positives, especially with reference overrides ($syntax) that resolve to functionally equivalent versions despite being structurally different. The fix removes this check because: 1. satisfiedBy() already validates version requirements 2. Real conflicts are caught during build/reify phase 3. The check compared override sets structurally, not functionally
|
This really needs to be resolved before Node 24 becomes LTS. Basic functionality like |
|
I'm not sure that removing the check altogether is what we need here. Shouldn't the fix be in the set detection itself? This seems like just ignoring a thing that's giving us an error to make the error go away, rather than fixing the part that's making it error. |
|
I am not familiar enough with the code to comment but if you can give some pointers, I can try to make the fix better |
…arison Instead of removing override conflict detection entirely, enhance it to use semantic comparison of version requirements rather than pure structural equality checking.
|
So |
|
Maybe @owlstronaut who did the original PR has some comments? |
Resolves the issue where different override contexts (like Vaadin's$@vaadin/react-components vs $ @vaadin/react-components-pro) were incorrectly treated as conflicts by structural comparison.
Fixes #8688