-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(ws): performance improvements #4142
Conversation
21deab7
to
4466e50
Compare
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.
do we need this one if you did changes here?
https://github.com/novuhq/novu/pull/4126/files#r1319969641
31eb912
to
9d42f8d
Compare
A change from |
if (command.event === WebSocketEventEnum.UNSEEN) { | ||
await this.sendUnseenCountChange(command); | ||
} | ||
|
||
if (command.event === WebSocketEventEnum.UNREAD) { | ||
await this.sendUnreadCountChange(command); | ||
} |
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.
Is this still needed or it's for backwards compatible version of a worker? Since if we now only send the RECEIVED
those will never run?
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.
I mentioned it here: #4152 (comment)
Headless and Notification Center still use those events. @LetItRock confirmed.
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.
They used to listen to them, but the only producer of those is the worker from my memory. After your refactoring they will still get them because of line https://github.com/novuhq/novu/pull/4142/files#diff-69a5fd44e678889585214e635e81e988c3a95a541e36d30df6de70d7e345bcd3R47
So those lines I'm seeing here should only executed if the worker still sends the old event names. If that makes sense
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.
Here they are used as events are being sent:
novu/apps/api/src/app/widgets/usecases/mark-all-messages-as/mark-all-messages-as.usecase.ts
Line 68 in ec38dd9
this.webSocketsQueueService.add( |
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.
Very good Catch! Totally forgot about it 💪
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.
Just a small question about the retro-competitive part, if it is for that than looks good🙏
What change does this PR introduce?
Integrates two tasks to improve the performance of the WebSockets.
Why was this change needed?
Performance improvements identified while migrating MemoryDB.
Other information (Screenshots)