n8n icon indicating copy to clipboard operation
n8n copied to clipboard

fix(editor): Debounce all parameter updates to minimise new workflow instance creation

Open MiloradFilipovic opened this issue 1 year ago • 2 comments

Summary

Currently, a new Workflow class instance is being created every time a node parameter is updated. This creates performance issues in the editor since this is fired too often (for example, on each key stroke in node parameter input). While proper solution is implemented (refactoring central workflow instance), this PR introduces a 300ms debounce to valueUpdated event which should minimize the number of new objects and free up some resources on the main thread.

Related tickets and issues

Fixes ADO-1524

Review / Merge checklist

  • [x] PR title and summary are descriptive. Remember, the title automatically goes into the changelog. Use (no-changelog) otherwise. (conventions)
  • [ ] Docs updated or follow-up ticket created.
  • [ ] Tests included.

    A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests.

MiloradFilipovic avatar Jan 25 '24 13:01 MiloradFilipovic

:warning: Some Cypress E2E specs are failing, please fix them before merging

github-actions[bot] avatar Jan 25 '24 20:01 github-actions[bot]

:warning: Some Cypress E2E specs are failing, please fix them before merging

github-actions[bot] avatar Jan 26 '24 11:01 github-actions[bot]

Closing for now since the debounce breaks other stuff and we are laying out the plan for a proper fix.

MiloradFilipovic avatar Jan 29 '24 09:01 MiloradFilipovic