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(core): updating deepCopy to avoid max callstack with circular deps #4468

Merged
merged 2 commits into from
Oct 28, 2022

Conversation

cstuncsik
Copy link
Contributor

@cstuncsik cstuncsik commented Oct 28, 2022

@cstuncsik cstuncsik marked this pull request as ready for review October 28, 2022 09:58
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Oct 28, 2022
@netroy
Copy link
Member

netroy commented Oct 28, 2022

Can we add a console.trace whenever we see a circular reference? that'd help a lot with narrowing down the sources of the issue.

@cstuncsik
Copy link
Contributor Author

@netroy I added console.warn only with path to prop. Would it be fine?
looks like this (taken from unit test)
image

@janober janober added the Upcoming Release Will be part of the upcoming release label Oct 28, 2022
@netroy
Copy link
Member

netroy commented Oct 28, 2022

I updated the benchmark, and it's not good news.
image

@netroy
Copy link
Member

netroy commented Oct 28, 2022

@netroy
Copy link
Member

netroy commented Oct 28, 2022

@netroy I added console.warn only with path to prop. Would it be fine? looks like this (taken from unit test)

This should be fine for now. I'll replace it with a warning that gets sents to sentry after #4394 is merged.

Copy link
Member

@netroy netroy left a comment

Choose a reason for hiding this comment

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

performs a lot better on v8 (chromium) so I'm assuming that the slow down is mostly in spidermonkey. we can optimize this another time.
image

@netroy netroy merged commit ca60b0e into master Oct 28, 2022
@netroy netroy deleted the fix-deepCopy branch October 28, 2022 13:25
@janober
Copy link
Member

janober commented Oct 28, 2022

Got released with n8n@0.200.1

@janober janober removed the Upcoming Release Will be part of the upcoming release label Oct 28, 2022
valya pushed a commit to valya/n8n that referenced this pull request Nov 8, 2022
n8n-io#4468)

* fix(core): updating deepCopy to avoid max callstack in case of circular dep

* fix(core): show warning with path added to circular reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants