-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
feat(core): reimplement blocking workflow updates on interim changes #4446
Conversation
There was a problem hiding this 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.
const state = JSON.stringify({ | ||
name, | ||
active, | ||
nodes, | ||
connections, | ||
settings, | ||
staticData, | ||
pinData, | ||
}); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got released with |
…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
Alternative to #4397