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

don't use same object reference in shallow dep info #66

Merged

Conversation

justinwoo
Copy link
Contributor

this causes us to create an invalid parent node that does not parse as a valid request in the API, due to the shared grandparent node being modified:

scarf-js/report.js

Lines 118 to 128 in 8bade0e

delete (dependencyInfo.rootPackage.packageJsonPath)
delete (dependencyInfo.rootPackage.path)
delete (dependencyInfo.rootPackage.name)
delete (dependencyInfo.rootPackage.version)
delete (dependencyInfo.parent.path)
delete (dependencyInfo.scarf.path)
if (dependencyInfo.grandparent) {
delete (dependencyInfo.grandparent.path)
delete (dependencyInfo.grandparent.name)
delete (dependencyInfo.grandparent.version)
}

fixes problems from #60

this causes us to create an invalid parent node that does not parse as a
valid request in the API, due to the shared grandparent node being
modified: https://github.com/scarf-sh/scarf-js/blob/8bade0e1b1ed705305e016f480beac36abef4cc0/report.js#L118-L128
Copy link
Member

@alexbiehl alexbiehl left a comment

Choose a reason for hiding this comment

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

Good catch!

@aviaviavi aviaviavi merged commit ba916b8 into master Aug 16, 2023
15 checks passed
@aviaviavi aviaviavi deleted the dont-use-shared-reference-parent-grandparent-skip-traversal branch August 16, 2023 15:07
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.

3 participants