-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix: avoid listening all events #8864
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
Conversation
WalkthroughWalkthroughThe recent changes focus on enhancing event handling in the Changes
Sequence Diagram(s)sequenceDiagram
participant App as AppHooksService
participant Notification as NotificationsService
participant Event as AppEvents
App->>Event: Subscribe to COMMENT_CREATE
App->>Event: Subscribe to COMMENT_UPDATE
App->>Event: Subscribe to COMMENT_DELETE
Notification->>Event: Subscribe to PROJECT_INVITE
Notification->>Event: Subscribe to WELCOME
Event-->>Notification: Trigger PROJECT_INVITE
Notification->>Notification: handle PROJECT_INVITE
Event-->>Notification: Trigger WELCOME
Notification->>Notification: handle WELCOME
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/nocodb/src/services/app-hooks/app-hooks.service.ts (1 hunks)
- packages/nocodb/src/services/notifications/notifications.service.ts (1 hunks)
Additional context used
Biome
packages/nocodb/src/services/app-hooks/app-hooks.service.ts
[error] 52-52: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabledoption totruein your configuration file.
Additional comments not posted (2)
packages/nocodb/src/services/notifications/notifications.service.ts (1)
245-246: Optimization of event subscriptionsThe changes in the
onModuleInitmethod to subscribe only toPROJECT_INVITEandWELCOMEevents align with the PR objective to reduce unnecessary overhead by avoiding listening to all events. This should enhance performance by reducing the number of handlers invoked for irrelevant events.packages/nocodb/src/services/app-hooks/app-hooks.service.ts (1)
61-61: Clarification on return type additionThe addition of the explicit return type
() => voidto theonmethod for specific events is a good practice. It makes the API more predictable and easier to use by clearly specifying what the function returns, thereby enhancing type safety and maintainability.
|
Uffizzi Preview |
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.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/nocodb/src/services/app-hooks/app-hooks.service.ts (1 hunks)
- packages/nocodb/src/services/notifications/notifications.service.ts (1 hunks)
Additional context used
Biome
packages/nocodb/src/services/app-hooks/app-hooks.service.ts
[error] 52-52: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabledoption totruein your configuration file.
packages/nocodb/src/services/notifications/notifications.service.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: mertmit <mertmit99@gmail.com>
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/nocodb/src/services/notifications/notifications.service.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/nocodb/src/services/notifications/notifications.service.ts
Change Summary
Only listen specific events to avoid extra overhead
Change type