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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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 #8868

Run Properties:  status check passed Passed #8868  •  git commit c6f25fba38: 🌳 node-1517-expression-extensions-typing-reverse-crashes-fe-2 🖥️ browsers:node...
Project n8n
Branch Review node-1517-expression-extensions-typing-reverse-crashes-fe-2
Run status status check passed Passed #8868
Run duration 04m 57s
Commit git commit c6f25fba38: 🌳 node-1517-expression-extensions-typing-reverse-crashes-fe-2 🖥️ browsers:node...
Committer Elias Meire
View all properties for this run ↗︎

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

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 ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant