-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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(editor): Fix issues with push connect reconnection #13085
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Absolutely beautiful work! 😍
Left a few comments, but feel free to ignore if you think it's unnecessary.
import { useEventSourceClient } from '../useEventSourceClient'; | ||
|
||
/** Mocked EventSource class to help testing */ | ||
class MockEventSource extends EventTarget { |
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.
Would it make sense to extract this and MockWebSocket
to src/__tests__/mocks.ts
?
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.
Good point. Moved the mocks to their own files
const heartbeatTimer = ref<ReturnType<typeof setInterval> | null>(null); | ||
|
||
const startHeartbeat = () => { | ||
heartbeatTimer.value = setInterval(() => { | ||
socket.value?.send(JSON.stringify({ type: 'heartbeat' })); | ||
}, 30_000); | ||
}; | ||
|
||
const stopHeartbeat = () => { | ||
if (heartbeatTimer.value) { | ||
clearInterval(heartbeatTimer.value); | ||
heartbeatTimer.value = null; | ||
} | ||
}; |
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 extract this functionality into a useHeartbeat
composable? Could be reused for other polling-type checks later.
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.
👍 moved out
|
n8n
|
Project |
n8n
|
Branch Review |
cat-622-issues-with-websocket-reconnection
|
Run status |
|
Run duration | 04m 43s |
Commit |
|
Committer | Tomi Turtiainen |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
5
|
|
0
|
|
433
|
View all changes introduced in this branch ↗︎ |
@alexgrozav addressed the feedback. Please have another look 🙏 |
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.
Thank you for addressing all the feedback!
|
✅ All Cypress E2E specs passed |
Summary
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/CAT-622/issues-with-websocket-reconnection
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)