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

fix(core): Handle websocket connection error more gracefully in task runners #11635

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Nov 7, 2024

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Nov 7, 2024
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@@ -88,6 +88,18 @@ export abstract class TaskRunner {
},
maxPayload: opts.maxPayloadSize,
});

this.ws.addEventListener('error', (error) => {
if (error.message?.includes('ECONNREFUSED') || error.message?.includes('ENOTFOUND')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could check error.code instead of using message

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 error has no code it seems: https://share.cleanshot.com/23B8xxCy

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right, sorry, I meant error.error.code. And maybe rename error to event so it's event.error instead of error.error

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 requested a review from tomi November 8, 2024 13:45
Copy link
Contributor

@tomi tomi left a comment

Choose a reason for hiding this comment

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

🚀

Copy link

cypress bot commented Nov 8, 2024

n8n    Run #7799

Run Properties:  status check passed Passed #7799  •  git commit 85e9c72aca: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project n8n
Branch Review cat-318
Run status status check passed Passed #7799
Run duration 04m 23s
Commit git commit 85e9c72aca: 🌳 🖥️ 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 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 466
View all changes introduced in this branch ↗︎

Copy link
Contributor

github-actions bot commented Nov 8, 2024

✅ All Cypress E2E specs passed

@ivov ivov merged commit af7d6e6 into master Nov 11, 2024
46 checks passed
@ivov ivov deleted the cat-318 branch November 11, 2024 10:30
@github-actions github-actions bot mentioned this pull request Nov 13, 2024
@janober
Copy link
Member

janober commented Nov 13, 2024

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants