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

feat(core): reimplement blocking workflow updates on interim changes #4446

Merged
merged 17 commits into from
Oct 31, 2022

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Oct 26, 2022

Alternative to #4397

@linear
Copy link

linear bot commented Oct 26, 2022

N8N-5237

@ivov ivov changed the title Reimplement blocking workflow updates on interim changes feat(core): reimplement blocking workflow updates on interim changes Oct 26, 2022
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Oct 26, 2022
krynble
krynble previously approved these changes Oct 26, 2022
Copy link
Contributor

@krynble krynble left a comment

Choose a reason for hiding this comment

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

Looking great, tested with two users, multiple changes, all working fine. My two comments aim to simplify the checks and reduce possibly unnecessary warnings.

Comment on lines +103 to +111
const state = JSON.stringify({
name,
active,
nodes,
connections,
settings,
staticData,
pinData,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should simplify this to use only nodes and connections. Maybe pinData.

This reduces the chance of having issues with unnecessary warnings such as name changes or activation status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! As discussed, any editable parts of the workflow that we exclude from the hash will cause changes to those parts to be overwritable, which we likely do not want, so keeping it strict for now.

@@ -355,6 +355,14 @@ workflowsController.patch(
);
}

if (incomingHash !== shared.workflow.hash) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this check only if the payload contains nodes and connections? Perhaps pinData too?

This reduces the chance of us making checks and warnings unnecessarily.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ivov ivov merged commit 46905fd into master Oct 31, 2022
@ivov ivov deleted the n8n-5237-reimplement-blocking-interim-workflow-updates branch October 31, 2022 09:35
@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Oct 31, 2022
@janober
Copy link
Member

janober commented Nov 2, 2022

Got released with n8n@0.201.0

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

* 📘 Update request type

* 📘 Update FE types

* ⚡ Adjust store

* ⚡ Set received hash

* ⚡ Send and load hash

* ⚡ Make helper more flexible

* 🗃️ Add new field to entity

* 🚨 Add check to endpoint

* 🧪 Add tests

* ⚡ Add `forceSave` flag

* 🐛 Fix workflow update failing on new workflow

* 🧪 Add more tests

* ⚡ Move check to `updateWorkflow()`

* ⚡ Refactor to accommodate latest changes

* 🧪 Refactor tests to keep them passing

* ⚡ Improve syntax
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 ui Enhancement in /editor-ui or /design-system User Management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants