-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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): Fix push message type inference #12331
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.
besides the comment in PubSubHandler
, LGTM
@@ -156,7 +157,7 @@ export class PubSubHandler { | |||
'relay-execution-lifecycle-event': async ({ type, args, pushRef }) => { | |||
if (!this.push.getBackend().hasPushRef(pushRef)) return; | |||
|
|||
this.push.send(type, args, pushRef); | |||
this.push.send({ type, data: args } as PushMessage, pushRef); |
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.
instead of casting as PushMessage
here, maybe we could update the types for this event in packages/cli/src/events/maps/pub-sub.event-map.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.
Ended up removing all generics from push as well: 75b9e71
n8n Run #8453
Run Properties:
|
Project |
n8n
|
Branch Review |
master
|
Run status |
Passed #8453
|
Run duration | 04m 54s |
Commit |
fe7fb41ad8: 🌳 master 🖥️ browsers:node18.12.0-chrome107 🤖 PR User 🗃️ e2e/*
|
Committer | Iván Ovejero |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
3
|
Pending |
0
|
Skipped |
0
|
Passing |
483
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
This PR adjusts the
Push.send
argument so that TypeScript is able to narrow down payloads based on push types.