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

refactor(core): Simplify webhook pubsub message handler #11048

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Oct 2, 2024

Simplfy pubsub message handling in a webhook process using typed event emitter, add tests, and delete handleCommandMessageWebhook and OrchestrationHandlerWebhookService.

https://linear.app/n8n/issue/PAY-2023

Ref: #10566

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Oct 2, 2024
Comment on lines +115 to +119
const subscriber = Container.get(Subscriber);
await subscriber.subscribe('n8n.commands');
subscriber.setCommandMessageHandler();

Container.get(PubSubHandler).init();
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
const subscriber = Container.get(Subscriber);
await subscriber.subscribe('n8n.commands');
subscriber.setCommandMessageHandler();
Container.get(PubSubHandler).init();
Container.get(PubSubHandler).init();
const subscriber = Container.get(Subscriber);
subscriber.setCommandMessageHandler();
await subscriber.subscribe('n8n.commands');

Would this order also work and prevent use form missing messages?

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! It's a tiny window - I'll address in the next PR 👍🏻

Copy link

cypress bot commented Oct 2, 2024

n8n    Run #7141

Run Properties:  status check passed Passed #7141  •  git commit d6f3629a39: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project n8n
Branch Review simplify-webhook-pubsub-msg-handler
Run status status check passed Passed #7141
Run duration 04m 27s
Commit git commit d6f3629a39: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Committer Iván Ovejero
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
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 437
View all changes introduced in this branch ↗︎

Copy link
Contributor

github-actions bot commented Oct 2, 2024

✅ All Cypress E2E specs passed

@ivov ivov merged commit 73a0d48 into master Oct 4, 2024
51 of 52 checks passed
@ivov ivov deleted the simplify-webhook-pubsub-msg-handler branch October 4, 2024 07:28
@janober
Copy link
Member

janober commented Oct 9, 2024

Got released with n8n@1.63.0

1 similar comment
@janober
Copy link
Member

janober commented Oct 9, 2024

Got released with n8n@1.63.0

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants