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

N8N-2586 Improve Waiting Webhook call state in WF Canvas #2430

Merged

Conversation

SchnapsterDog
Copy link
Contributor

No description provided.

@SchnapsterDog SchnapsterDog self-assigned this Nov 12, 2021
@SchnapsterDog SchnapsterDog marked this pull request as ready for review November 12, 2021 11:01
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
…, it is a trigger node, if it is only one trigger node in WF
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
…ctveTriggerNodesInWokrflow, Add style to trigger node's tooltip, remove comments
…nterface, Updated Logic for TriggerNode Tooltip based on the new prop
@SchnapsterDog
Copy link
Contributor Author

Copy link
Contributor

@mutdmour mutdmour left a comment

Choose a reason for hiding this comment

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

thanks for making all the fixes. I think we are almost there.

packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
handler(isWorkflowRunning) {
if (isWorkflowRunning && this.isTriggerNode && this.isSingleActiveTriggerNode && !this.isTriggerNodeTooltipEmpty) {
setTimeout(() => {
this.showWebhookNodeTooltip = isWorkflowRunning;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is still buggy.. I think you need to check here again that it's still running
Screen Shot 2021-11-17 at 9 30 05 AM
to reproduce:

  1. execute workflow
  2. pause before tooltip shows

Copy link
Contributor

Choose a reason for hiding this comment

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

if node errors out, still shows tooltip
Screen Shot 2021-11-17 at 9 38 08 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

same thing if node runs successfully before timeout
Screen Shot 2021-11-17 at 9 40 35 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This three scenarios are fixed with the latest push.
-If node runs successfully before timeout, it would not show the tooltip.
-Also if node hasIssues will not show the tooltip.
-Also if Paused node is paused before the tooltip is shown.

And one more scenario. If one of the nodes are paused during execution, the watcher update the prop.

packages/editor-ui/src/components/Node.vue Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/store.ts Outdated Show resolved Hide resolved
… has issues, if paused, if wokrlfow is running, Refactor Getter
@mutdmour
Copy link
Contributor

@SchnapsterDog one more scenario that just came to me
Screen Shot 2021-11-18 at 5 29 57 PM

to reproduce:

  1. run workflow with webhook node
  2. open node before tooltip is shown

@SchnapsterDog
Copy link
Contributor Author

@SchnapsterDog one more scenario that just came to me Screen Shot 2021-11-18 at 5 29 57 PM

to reproduce:

  1. run workflow with webhook node
  2. open node before tooltip is shown

This is also fixed.

packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
Comment on lines 314 to 323
getTriggerNodeTooltip (): string | undefined {
if (this.nodeType !== null && this.nodeType.hasOwnProperty('eventTriggerDescription')) {
return this.nodeType.eventTriggerDescription;
} else {
return `Waiting for you to create an event in ${this.getTrimmedTriggerNodeTypeName()}`;
}
},
getTrimmedTriggerNodeTypeName() {
return this.nodeType && this.nodeType.displayName.replace(/Trigger/, "");
},
Copy link
Contributor

Choose a reason for hiding this comment

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

can you make these into one computed property.. it does not need to be a method...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done into one computed property.

nodeType (): INodeTypeDescription | null {
return this.$store.getters.nodeType(this.data.type);
},
node (): INodeUi | undefined {
return this.$store.getters.nodesByName[this.name] as INodeUi;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return this.$store.getters.nodesByName[this.name] as INodeUi;
return this.$store.getters.nodesByName[this.name] as INodeUi | undefined;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -738,6 +738,11 @@ export const store = new Vuex.Store({
return state.activeWorkflows;
},

activeWorkflowTriggerNodes: (state, getters) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe rename this to workflowTriggerNodes.. I suggested active before because I thought we would also check if nodes are disabled.
Otherwise update code to only return active (not disabled) nodes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamaed

Comment on lines 256 to 258
if (this.workflowRunning) {
this.showTriggerNodeTooltip = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we should always check in the handler that we should show tooltip. otherwise we have a race condition between our two handlers.

Suggested change
if (this.workflowRunning) {
this.showTriggerNodeTooltip = true;
}
this.showTriggerNodeTooltip = this.shouldShowTooltip;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -207,13 +239,35 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).ext
shiftOutputCount (): boolean {
return !!(this.nodeType && this.nodeType.outputs.length > 2);
},
},
shouldShowTooltip () : boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick - just can be a little more clear... since we have another tooltip in nodes (error tooltip)

Suggested change
shouldShowTooltip () : boolean {
shouldShowTriggerTooltip () : boolean {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored

packages/editor-ui/src/components/Node.vue Outdated Show resolved Hide resolved
Copy link
Contributor

@mutdmour mutdmour left a comment

Choose a reason for hiding this comment

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

Good job 🙏

@SchnapsterDog
Copy link
Contributor Author

Good job 🙏

Thanks for your directions :)

@janober janober merged commit adc2515 into master Nov 25, 2021
@janober janober deleted the feature/n8n-2586-improve-waiting-for-webhook-call-state branch November 25, 2021 22:33
@janober
Copy link
Member

janober commented Nov 25, 2021

Thanks a lot. Got merged.

@janober
Copy link
Member

janober commented Nov 26, 2021

Got released with n8n@0.151.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants