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(editor): Prevent infinite loop in expressions crashing the browser #12732

Merged

Conversation

elsmr
Copy link
Member

@elsmr elsmr commented Jan 20, 2025

Summary

  • Move logic to resolve expressions for parameters into 1 place and debounce updates
  • Update using watchers (or computedWithControl) instead of computed to limit rerenders

To reproduce:

  • Return an array from a node
  • Add an expression in the next node that mutates the data {{ array.reverse() }}
  • Before: browser crash, After: works fine

⚠️ The mutation of input data is not fixed in this PR

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/PAY-1261/bug-expression-freezing-workflow

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jan 20, 2025
Copy link

codecov bot commented Jan 21, 2025

Copy link

cypress bot commented Jan 21, 2025

n8n    Run #9075

Run Properties:  status check passed Passed #9075  •  git commit 51046014ed: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 elsmr 🗃️ e2e/*
Project n8n
Branch Review node-1517-expression-extensions-typing-reverse-crashes-fe-2
Run status status check passed Passed #9075
Run duration 04m 26s
Commit git commit 51046014ed: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 elsmr 🗃️ e2e/*
Committer Elias Meire
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 5
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 433
View all changes introduced in this branch ↗︎

Copy link
Contributor

@r00gm r00gm left a comment

Choose a reason for hiding this comment

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

It works as promised ❤️

Copy link
Contributor

github-actions bot commented Feb 3, 2025

✅ All Cypress E2E specs passed

@elsmr elsmr merged commit 8c2dbcf into master Feb 3, 2025
37 checks passed
@elsmr elsmr deleted the node-1517-expression-extensions-typing-reverse-crashes-fe-2 branch February 3, 2025 11:50
This was referenced Feb 5, 2025
@janober
Copy link
Member

janober commented Feb 6, 2025

Got released with n8n@1.78.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants