-
Notifications
You must be signed in to change notification settings - Fork 6
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: add debug logs in api #294
Conversation
Warning Rate limit exceeded@kshitij-k-osmosys has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 34 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes enhance the application's logging capabilities by introducing a new configuration parameter, Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Controller
participant Service
participant Logger
participant Queue
Client->>Controller: Send Notification Data
Controller->>Service: Create Notification
Service->>Logger: Log Incoming Data
Service->>Queue: Add Notification to Queue
Queue->>Logger: Log Queueing Process
Queue->>Service: Notify Success
Service-->>Controller: Response
Controller-->>Client: Send Response
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 Configuration 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: 2
Outside diff range, codebase verification and nitpick comments (20)
apps/api/src/common/guards/api-key/api-key.guard.ts (14)
35-36
: Add context to log messages.The log messages are clear but can be enhanced by including additional context such as the request ID or user ID for better traceability.
- this.logger.debug('HTTP Request was issued'); + this.logger.debug(`HTTP Request was issued for request ID: ${request.id}`);
53-54
: Add context to log messages.Similar to the HTTP request log messages, include additional context such as the request ID or user ID for better traceability.
- this.logger.debug('GraphQL Request was issued'); + this.logger.debug(`GraphQL Request was issued for request ID: ${req.id}`);
82-82
: Improve log message clarity.The log message can be improved by providing more context about the server API key being fetched.
- this.logger.debug(`Fetching Server API Key from request token: ${JSON.stringify(apiKeyEntry)}`); + this.logger.debug(`Fetched Server API Key entry: ${JSON.stringify(apiKeyEntry)}`);
91-91
: Improve log message clarity.The log message can be improved by providing more context about the provider entry being fetched.
- this.logger.debug(`Fetching provider by request providerId: ${JSON.stringify(providerEntry)}`); + this.logger.debug(`Fetched provider entry for providerId: ${requestProviderId}: ${JSON.stringify(providerEntry)}`);
106-108
: Improve log message clarity.The log message can be improved by providing more context about the application ID being set.
- this.logger.debug(`Set correct ApplicationId for request: ${JSON.stringify(inputApplicationId)}`); + this.logger.debug(`Set correct ApplicationId for request with providerId: ${requestProviderId}: ${JSON.stringify(inputApplicationId)}`);
116-118
: Improve log message clarity.The log message can be improved by providing more context about the validation result.
- this.logger.debug('Requested providerId is valid. The applicationId for Server Key and Provider match. Valid Request.'); + this.logger.debug(`Requested providerId: ${requestProviderId} is valid. The applicationId for Server Key and Provider match. Valid Request.`);
82-82
: Improve log message clarity.The log message can be improved by providing more context about the server API key being fetched.
- this.logger.debug(`Fetching Server API Key from request token: ${JSON.stringify(apiKeyEntry)}`); + this.logger.debug(`Fetched Server API Key entry: ${JSON.stringify(apiKeyEntry)}`);
91-91
: Improve log message clarity.The log message can be improved by providing more context about the provider entry being fetched.
- this.logger.debug(`Fetching provider by request providerId: ${JSON.stringify(providerEntry)}`); + this.logger.debug(`Fetched provider entry for providerId: ${requestProviderId}: ${JSON.stringify(providerEntry)}`);
106-108
: Improve log message clarity.The log message can be improved by providing more context about the application ID being set.
- this.logger.debug(`Set correct ApplicationId for request: ${JSON.stringify(inputApplicationId)}`); + this.logger.debug(`Set correct ApplicationId for request with providerId: ${requestProviderId}: ${JSON.stringify(inputApplicationId)}`);
116-118
: Improve log message clarity.The log message can be improved by providing more context about the validation result.
- this.logger.debug('Requested providerId is valid. The applicationId for Server Key and Provider match. Valid Request.'); + this.logger.debug(`Requested providerId: ${requestProviderId} is valid. The applicationId for Server Key and Provider match. Valid Request.`);
82-82
: Improve log message clarity.The log message can be improved by providing more context about the server API key being fetched.
- this.logger.debug(`Fetching Server API Key from request token: ${JSON.stringify(apiKeyEntry)}`); + this.logger.debug(`Fetched Server API Key entry: ${JSON.stringify(apiKeyEntry)}`);
91-91
: Improve log message clarity.The log message can be improved by providing more context about the provider entry being fetched.
- this.logger.debug(`Fetching provider by request providerId: ${JSON.stringify(providerEntry)}`); + this.logger.debug(`Fetched provider entry for providerId: ${requestProviderId}: ${JSON.stringify(providerEntry)}`);
106-108
: Improve log message clarity.The log message can be improved by providing more context about the application ID being set.
- this.logger.debug(`Set correct ApplicationId for request: ${JSON.stringify(inputApplicationId)}`); + this.logger.debug(`Set correct ApplicationId for request with providerId: ${requestProviderId}: ${JSON.stringify(inputApplicationId)}`);
116-118
: Improve log message clarity.The log message can be improved by providing more context about the validation result.
- this.logger.debug('Requested providerId is valid. The applicationId for Server Key and Provider match. Valid Request.'); + this.logger.debug(`Requested providerId: ${requestProviderId} is valid. The applicationId for Server Key and Provider match. Valid Request.`);apps/api/src/common/decorators/is-data-valid.decorator.ts (1)
42-44
: Improve log message clarity.The log message can be improved by providing more context about the channel type being fetched.
- this.logger.debug(`Fetched channel type: ${channelTypeFromProviderId} from provider Id: ${object.providerId}`); + this.logger.debug(`Fetched channel type: ${channelTypeFromProviderId} for provider Id: ${object.providerId}`);apps/api/src/jobs/consumers/notifications/notification.consumer.ts (5)
42-44
: Improve log message clarity.The log message can be improved by providing more context about the notification ID and channel type.
- this.logger.debug(`Channel type: ${notification.channelType} is included in skip queue. Provider confirmation skipped for notification id ${notification.id}`); + this.logger.debug(`Channel type: ${notification.channelType} is included in skip queue. Provider confirmation skipped for notification ID: ${notification.id}`);
48-50
: Improve log message clarity.The log message can be improved by providing more context about the notification ID.
- this.logger.debug(`Notification id ${notification.id} is awaiting confirmation from provider`); + this.logger.debug(`Notification ID: ${notification.id} is awaiting confirmation from provider`);
54-54
: Improve log message clarity.The log message can be improved by providing more context about the notification ID.
- this.logger.debug(`Updating result of notification with id ${notification.id}`); + this.logger.debug(`Updating result of notification with ID: ${notification.id}`);
58-60
: Fix typo in log message.There is a typo in the log message ("occurred" is misspelled as "occured").
- this.logger.debug(`Some error occured while sendiing Notification with ID ${notification.id}. Retry Count ${notification.retryCount}/${this.maxRetryCount}. Sending notification again`); + this.logger.debug(`Some error occurred while sending Notification with ID: ${notification.id}. Retry Count: ${notification.retryCount}/${this.maxRetryCount}. Sending notification again`);
132-132
: Improve log message clarity.The log message can be improved by providing more context about the notification ID.
- this.logger.debug('Saving notification data in DB'); + this.logger.debug(`Saving notification data in DB for notification ID: ${notification.id}`);
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (19)
- apps/api/.env.example (1 hunks)
- apps/api/src/common/decorators/is-data-valid.decorator.ts (2 hunks)
- apps/api/src/common/guards/api-key/api-key.guard.ts (6 hunks)
- apps/api/src/config/logger.config.ts (2 hunks)
- apps/api/src/jobs/consumers/notifications/notification.consumer.ts (3 hunks)
- apps/api/src/jobs/producers/notifications/notifications.job.producer.ts (1 hunks)
- apps/api/src/modules/notifications/notifications.controller.ts (1 hunks)
- apps/api/src/modules/notifications/notifications.service.ts (1 hunks)
- apps/api/src/modules/notifications/queues/queue.service.ts (2 hunks)
- apps/api/src/modules/providers/mailgun/mailgun.service.ts (6 hunks)
- apps/api/src/modules/providers/push-sns/push-sns.service.ts (3 hunks)
- apps/api/src/modules/providers/sms-kapsystem/sms-kapsystem.service.ts (3 hunks)
- apps/api/src/modules/providers/sms-plivo/sms-plivo.service.ts (4 hunks)
- apps/api/src/modules/providers/sms-twilio/sms-twilio.service.ts (4 hunks)
- apps/api/src/modules/providers/smtp/smtp.service.ts (2 hunks)
- apps/api/src/modules/providers/vc-twilio/vc-twilio.service.ts (4 hunks)
- apps/api/src/modules/providers/wa-twilio-business/wa-twilio-business.service.ts (4 hunks)
- apps/api/src/modules/providers/wa-twilio/wa-twilio.service.ts (4 hunks)
- apps/api/src/modules/providers/wa360dialog/wa360dialog.service.ts (3 hunks)
Files skipped from review due to trivial changes (3)
- apps/api/.env.example
- apps/api/src/modules/notifications/notifications.controller.ts
- apps/api/src/modules/notifications/notifications.service.ts
Additional context used
Learnings (3)
apps/api/src/modules/providers/wa-twilio-business/wa-twilio-business.service.ts (1)
Learnt from: LakshayaT PR: OsmosysSoftware/osmo-x#263 File: apps/api/src/modules/providers/wa-twilio/wa-twilio.service.ts:0-0 Timestamp: 2024-06-28T05:13:41.818Z Learning: LakshayaT has implemented error handling in the `sendMessage` method of `WaTwilioService` as suggested by CodeRabbit, ensuring that errors are not suppressed and are properly logged.
apps/api/src/modules/providers/wa-twilio/wa-twilio.service.ts (1)
Learnt from: LakshayaT PR: OsmosysSoftware/osmo-x#263 File: apps/api/src/modules/providers/wa-twilio/wa-twilio.service.ts:0-0 Timestamp: 2024-06-28T05:13:41.818Z Learning: LakshayaT has implemented error handling in the `sendMessage` method of `WaTwilioService` as suggested by CodeRabbit, ensuring that errors are not suppressed and are properly logged.
apps/api/src/jobs/consumers/notifications/notification.consumer.ts (1)
Learnt from: LakshayaT PR: OsmosysSoftware/osmo-x#263 File: apps/api/src/jobs/consumers/notifications/notification.consumer.ts:36-40 Timestamp: 2024-07-03T05:58:54.296Z Learning: When reviewing retry mechanisms and delivery status updates, if the error object is already being logged, additional log messages for retry count and status might be redundant.
Biome
apps/api/src/common/guards/api-key/api-key.guard.ts
[error] 34-34: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Additional comments not posted (51)
apps/api/src/modules/providers/smtp/smtp.service.ts (2)
13-13
: LGTM! Debug log added for SMTP transport assignment.The debug log statement provides useful information about the start of the SMTP transport assignment.
30-30
: LGTM! Debug log added for sending SMTP email.The debug log statement provides useful information about the initiation of the email sending process.
apps/api/src/modules/providers/push-sns/push-sns.service.ts (2)
18-18
: LGTM! Debug log added for SNS client assignment.The debug log statement provides useful information about the start of the SNS client assignment.
38-38
: LGTM! Debug log added for sending SNS push notification.The debug log statement provides useful information about the initiation of the push notification sending process.
apps/api/src/jobs/producers/notifications/notifications.job.producer.ts (2)
17-19
: LGTM! Debug log added for provider fetching.The debug log statement provides useful information about the fetched provider and the associated notification.
25-25
: LGTM! Debug log added for notification queuing.The debug log statement provides useful information about the notification being added to the queue.
apps/api/src/config/logger.config.ts (3)
6-6
: Import statement forConfigService
looks good.The import statement for
ConfigService
is correctly added.
8-8
: Instance creation forConfigService
looks good.The instance of
ConfigService
is correctly created.
63-63
: Dynamic logger level configuration looks good.The logger level is dynamically set using the
LOG_LEVEL
configuration with a default value of'info'
.apps/api/src/modules/providers/wa360dialog/wa360dialog.service.ts (4)
2-2
: Import statement forLogger
looks good.The import statement for
Logger
is correctly added.
53-53
: Constructor changes forLogger
injection look good.The
Logger
is correctly injected into the constructor ofWa360dialogService
.
57-57
: Debug log statement inassignWA360Values
looks good.The debug log statement at the beginning of the method indicates the start of the value assignment process.
69-69
: Debug log statement insendMessage
looks good.The debug log statement before sending the HTTP request indicates that the SMS is being dispatched.
apps/api/src/modules/providers/sms-kapsystem/sms-kapsystem.service.ts (4)
2-2
: Import statement forLogger
looks good.The import statement for
Logger
is correctly added.
37-37
: Constructor changes forLogger
injection look good.The
Logger
is correctly injected into the constructor ofSmsKapsystemService
.
41-41
: Debug log statement inassignKAPSystemValues
looks good.The debug log statement at the beginning of the method indicates the start of the value assignment process.
71-71
: Debug log statement insendMessage
looks good.The debug log statement before sending the HTTP request indicates that the SMS is being dispatched.
apps/api/src/modules/providers/sms-twilio/sms-twilio.service.ts (3)
41-41
: LGTM!The debug log statement provides useful information about the start of the transport assignment process.
53-53
: LGTM!The debug log statement provides useful information about the SMS sending process.
64-67
: LGTM!The debug log statements provide useful information about the delivery status fetching process and the retrieved status message.
apps/api/src/modules/providers/wa-twilio-business/wa-twilio-business.service.ts (3)
43-43
: LGTM!The debug log statement provides useful information about the start of the transport assignment process.
55-55
: LGTM!The debug log statement provides useful information about the WhatsApp Business message-sending process.
67-70
: LGTM!The debug log statements provide useful information about the delivery status fetching process and the retrieved status message.
apps/api/src/modules/providers/wa-twilio/wa-twilio.service.ts (3)
41-41
: LGTM!The debug log statement provides useful information about the start of the transport assignment process.
59-59
: LGTM!The debug log statement provides useful information about the WhatsApp message-sending process.
68-71
: LGTM!The debug log statements provide useful information about the delivery status fetching process and the retrieved status message.
apps/api/src/modules/providers/sms-plivo/sms-plivo.service.ts (4)
1-1
: LGTM! Logger instance added.The
Logger
instance is correctly imported and initialized.Also applies to: 52-52
57-57
: LGTM! Debug log added toassignTransport
.The debug log statement is correctly placed and provides meaningful information.
70-70
: LGTM! Debug log added tosendMessage
.The debug log statement is correctly placed and provides meaningful information.
87-87
: LGTM! Debug logs added togetDeliveryStatus
.The debug log statements are correctly placed and provide meaningful information.
Also applies to: 90-90
apps/api/src/modules/providers/mailgun/mailgun.service.ts (6)
1-1
: LGTM! Logger instance added.The
Logger
instance is correctly imported and initialized.Also applies to: 21-21
28-28
: LGTM! Debug log added toassignClient
.The debug log statement is correctly placed and provides meaningful information.
44-44
: LGTM! Debug log added tosendEmail
.The debug log statement is correctly placed and provides meaningful information.
54-54
: LGTM! Debug log added toformatNotificationData
.The debug log statement is correctly placed and provides meaningful information.
73-73
: LGTM! Debug log added toformatAttachments
.The debug log statement is correctly placed and provides meaningful information.
101-101
: LGTM! Debug logs added togetDeliveryStatus
.The debug log statements are correctly placed and provide meaningful information.
Also applies to: 106-106
apps/api/src/modules/providers/vc-twilio/vc-twilio.service.ts (4)
1-1
: LGTM! Logger instance added.The
Logger
instance is correctly imported and initialized.Also applies to: 87-87
92-92
: LGTM! Debug log added toassignTransport
.The debug log statement is correctly placed and provides meaningful information.
151-151
: LGTM! Debug log added tosendVoiceCall
.The debug log statement is correctly placed and provides meaningful information.
161-161
: LGTM! Debug logs added togetDeliveryStatus
.The debug log statements are correctly placed and provide meaningful information.
Also applies to: 164-164
apps/api/src/common/guards/api-key/api-key.guard.ts (4)
29-31
: Add logging level configuration.The debug log statement is useful for tracing the request validation process. Ensure that the logging level is appropriately configured to avoid excessive logging in production.
Is the
LOG_LEVEL
configuration properly set in the environment file?
71-71
: Add logging level configuration.The debug log statement is useful for tracing the API key validation process. Ensure that the logging level is appropriately configured to avoid excessive logging in production.
Is the
LOG_LEVEL
configuration properly set in the environment file?
71-71
: Add logging level configuration.The debug log statement is useful for tracing the API key validation process. Ensure that the logging level is appropriately configured to avoid excessive logging in production.
Is the
LOG_LEVEL
configuration properly set in the environment file?
71-71
: Add logging level configuration.The debug log statement is useful for tracing the API key validation process. Ensure that the logging level is appropriately configured to avoid excessive logging in production.
Is the
LOG_LEVEL
configuration properly set in the environment file?apps/api/src/common/decorators/is-data-valid.decorator.ts (3)
29-32
: Ensure logger instance is properly configured.The addition of the
Logger
instance is appropriate for enhanced logging. Ensure that the logger is properly configured to respect the log level settings.Is the
Logger
instance properly configured to respect theLOG_LEVEL
settings?
35-35
: Add logging level configuration.The debug log statement is useful for tracing the validation process. Ensure that the logging level is appropriately configured to avoid excessive logging in production.
Is the
LOG_LEVEL
configuration properly set in the environment file?
50-50
: Add logging level configuration.The debug log statement is useful for tracing the validation process. Ensure that the logging level is appropriately configured to avoid excessive logging in production.
Is the
LOG_LEVEL
configuration properly set in the environment file?apps/api/src/jobs/consumers/notifications/notification.consumer.ts (2)
36-38
: Add logging level configuration.The debug log statement is useful for tracing the notification processing workflow. Ensure that the logging level is appropriately configured to avoid excessive logging in production.
Is the
LOG_LEVEL
configuration properly set in the environment file?
89-91
: Add logging level configuration.The debug log statement is useful for tracing the notification processing workflow. Ensure that the logging level is appropriately configured to avoid excessive logging in production.
Is the
LOG_LEVEL
configuration properly set in the environment file?apps/api/src/modules/notifications/queues/queue.service.ts (2)
75-75
: Good addition: Debug log statement.The debug log statement helps in tracking the initiation of the queue creation process.
88-90
: Good addition: Debug log statement.The debug log statement helps in tracking the details of the job being processed.
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/api/src/common/guards/api-key/api-key.guard.ts (6 hunks)
Additional context used
Biome
apps/api/src/common/guards/api-key/api-key.guard.ts
[error] 34-34: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Additional comments not posted (7)
apps/api/src/common/guards/api-key/api-key.guard.ts (7)
29-31
: LGTM! The log statement enhances observability.The debug log statement indicating the start of request validation is clear and useful for debugging.
35-35
: LGTM! Efficient logging.Combining the log statements for fetching the request header and provider ID reduces the number of log entries.
52-54
: LGTM! Efficient logging.Combining the log statements for fetching the request header and provider ID for GraphQL reduces the number of log entries.
71-71
: LGTM! The log statement enhances observability.The debug log statement indicating the start of
validateApiKeyHeader
is clear and useful for debugging.
82-82
: LGTM! The log statement enhances observability.The debug log statement for fetching the server API key from the request token is clear and useful for debugging.
91-91
: LGTM! The log statement enhances observability.The debug log statement for fetching the provider by request provider ID is clear and useful for debugging.
37-37
: Remove redundant log statement.The log statement for fetching the provider ID is redundant as it is already included in the previous log statement.
- this.logger.debug('Fetching provider Id');
Likely invalid or redundant comment.
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)
- apps/api/src/modules/providers/providers.service.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- apps/api/src/modules/providers/providers.service.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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (11)
- apps/api/src/jobs/producers/notifications/notifications.job.producer.ts (1 hunks)
- apps/api/src/modules/providers/mailgun/mailgun.module.ts (1 hunks)
- apps/api/src/modules/providers/push-sns/push-sns.module.ts (1 hunks)
- apps/api/src/modules/providers/sms-kapsystem/sms-kapsystem.module.ts (2 hunks)
- apps/api/src/modules/providers/sms-plivo/sms-plivo.module.ts (1 hunks)
- apps/api/src/modules/providers/sms-twilio/sms-twilio.module.ts (1 hunks)
- apps/api/src/modules/providers/smtp/smtp.module.ts (1 hunks)
- apps/api/src/modules/providers/vc-twilio/vc-twilio.module.ts (1 hunks)
- apps/api/src/modules/providers/wa-twilio-business/wa-twilio-business.module.ts (1 hunks)
- apps/api/src/modules/providers/wa-twilio/wa-twilio.module.ts (1 hunks)
- apps/api/src/modules/providers/wa360dialog/wa360dialog.module.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/api/src/jobs/producers/notifications/notifications.job.producer.ts
Additional comments not posted (14)
apps/api/src/modules/providers/vc-twilio/vc-twilio.module.ts (1)
1-1
: Add Logger service to providers array.The addition of the
Logger
service to the providers array enhances the module's logging capabilities, aligning with the PR objective.Also applies to: 8-8
apps/api/src/modules/providers/smtp/smtp.module.ts (1)
1-1
: Add Logger service to providers array.The addition of the
Logger
service to the providers array enhances the module's logging capabilities, aligning with the PR objective.Also applies to: 9-9
apps/api/src/modules/providers/wa-twilio-business/wa-twilio-business.module.ts (1)
1-1
: Add Logger service to providers array.The addition of the
Logger
service to the providers array enhances the module's logging capabilities, aligning with the PR objective.Also applies to: 8-8
apps/api/src/modules/providers/mailgun/mailgun.module.ts (1)
1-1
: LGTM! Ensure proper usage of the Logger service.The addition of the
Logger
service to theproviders
array is a good practice for enhancing logging capabilities. Make sure that theLogger
service is correctly utilized within theMailgunModule
.Also applies to: 9-9
apps/api/src/modules/providers/push-sns/push-sns.module.ts (1)
1-1
: LGTM! Ensure proper usage of the Logger service.The addition of the
Logger
service to theproviders
array is a good practice for enhancing logging capabilities. Make sure that theLogger
service is correctly utilized within thePushSnsModule
.Also applies to: 9-9
apps/api/src/modules/providers/sms-plivo/sms-plivo.module.ts (1)
1-1
: LGTM! Ensure proper usage of the Logger service.The addition of the
Logger
service to theproviders
array is a good practice for enhancing logging capabilities. Make sure that theLogger
service is correctly utilized within theSmsPlivoModule
.Also applies to: 9-9
apps/api/src/modules/providers/wa-twilio/wa-twilio.module.ts (2)
1-1
: ImportingLogger
from@nestjs/common
The import statement for
Logger
from@nestjs/common
is correctly added.
9-9
: AddingLogger
to the providers arrayThe
Logger
is correctly added to the providers array, enabling logging capabilities within the module.To ensure the
Logger
is effectively utilized, verify its usage in the services within this module.Verification successful
Logger is effectively utilized in the
WaTwilioService
.The
Logger
is imported and used within thewa-twilio.service.ts
file, confirming its role in logging activities within the module.
wa-twilio.service.ts
:Logger
is declared as a private member and used in theassignTransport
method for logging.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in the services within the `WaTwilioModule`. # Test: Search for the usage of `Logger` in the services. Expect: Logger is used for logging. rg --type python -A 5 'Logger' apps/api/src/modules/providers/wa-twilio/Length of output: 103
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in the services within the `WaTwilioModule`. # Test: Search for the usage of `Logger` in the services. Expect: Logger is used for logging. rg --type typescript -A 5 'Logger' apps/api/src/modules/providers/wa-twilio/Length of output: 111
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in the services within the `WaTwilioModule`. # Test: Search for the usage of `Logger` in the services. Expect: Logger is used for logging. rg -t ts -A 5 'Logger' apps/api/src/modules/providers/wa-twilio/Length of output: 2237
apps/api/src/modules/providers/sms-twilio/sms-twilio.module.ts (2)
1-1
: ImportingLogger
from@nestjs/common
The import statement for
Logger
from@nestjs/common
is correctly added.
9-9
: AddingLogger
to the providers arrayThe
Logger
is correctly added to the providers array, enabling logging capabilities within the module.To ensure the
Logger
is effectively utilized, verify its usage in the services within this module.Verification successful
Logger is effectively utilized in SmsTwilioService
The
Logger
is not only imported and declared insms-twilio.service.ts
, but it is also actively used for logging within the service.
sms-twilio.service.ts
:
this.logger.debug('Started assigning transport for SMS Twilio');
this.logger.debug('Sending Twilio SMS');
this.logger.debug('Fetching delivery status from twilio SMS');
this.logger.debug(\
Delivery status: ${message}`);`Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in the services within the `SmsTwilioModule`. # Test: Search for the usage of `Logger` in the services. Expect: Logger is used for logging. rg --type python -A 5 'Logger' apps/api/src/modules/providers/sms-twilio/Length of output: 104
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in the services within the `SmsTwilioModule`. # Test: Search for the usage of `Logger` in the services. Expect: Logger is used for logging. rg --type typescript -A 5 'Logger' apps/api/src/modules/providers/sms-twilio/Length of output: 112
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in the services within the `SmsTwilioModule`. # Test: Search for the usage of `Logger` in the services. Expect: Logger is used for logging. rg 'Logger' apps/api/src/modules/providers/sms-twilio/Length of output: 495
Script:
#!/bin/bash # Description: Verify the usage of `this.logger` in the SmsTwilioService. # Test: Search for the usage of `this.logger` in the SmsTwilioService. Expect: Logger is used for logging. rg 'this.logger' apps/api/src/modules/providers/sms-twilio/sms-twilio.service.tsLength of output: 319
apps/api/src/modules/providers/wa360dialog/wa360dialog.module.ts (2)
1-1
: ImportingLogger
from@nestjs/common
The import statement for
Logger
from@nestjs/common
is correctly added.
10-10
: AddingLogger
to the providers arrayThe
Logger
is correctly added to the providers array, enabling logging capabilities within the module.To ensure the
Logger
is effectively utilized, verify its usage in the services within this module.Verification successful
Logger usage verified
The
Logger
is correctly utilized in thewa360dialog.service.ts
file within theassignWA360Values
method, confirming its effective usage in the services of theWa360dialogModule
.
wa360dialog.service.ts
:
import { Injectable, Logger } from '@nestjs/common';
private logger: Logger,
this.logger.debug('Started assigning 360Dialog Whatsapp values');
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in the services within the `Wa360dialogModule`. # Test: Search for the usage of `Logger` in the services. Expect: Logger is used for logging. rg --type python -A 5 'Logger' apps/api/src/modules/providers/wa360dialog/Length of output: 105
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in the services within the `Wa360dialogModule`. # Test: Search for the usage of `Logger` in the services. Expect: Logger is used for logging. rg --type ts -A 5 'Logger' apps/api/src/modules/providers/wa360dialog/Length of output: 2388
apps/api/src/modules/providers/sms-kapsystem/sms-kapsystem.module.ts (2)
1-1
: Import statement change is correct.The import of
Logger
from@nestjs/common
is appropriate for adding logging capabilities.
10-10
: AddingLogger
to providers array is correct.Including
Logger
in theproviders
array enables logging within the module.Verify the usage of
Logger
in theSmsKapsystemService
.Verification successful
Adding
Logger
to providers array is correct.The
Logger
is properly set up and used within theSmsKapsystemService
class for logging purposes.
SmsKapsystemService
contains logging statements usingthis.logger
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in `SmsKapsystemService`. # Test: Search for the usage of `Logger` in `SmsKapsystemService`. Expect: Proper logging statements. rg --type python -A 5 $'SmsKapsystemService'Length of output: 74
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in `SmsKapsystemService`. # Test: Search for the usage of `Logger` in `SmsKapsystemService`. Expect: Proper logging statements. rg --type ts -A 5 'Logger' --files-with-matches | xargs rg -A 5 'SmsKapsystemService'Length of output: 1710
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in `SmsKapsystemService`. # Test: Search for the usage of `Logger` in `SmsKapsystemService`. Expect: Proper logging statements. rg 'Logger' apps/api/src/modules/providers/sms-kapsystem/sms-kapsystem.service.tsLength of output: 162
Script:
#!/bin/bash # Description: Verify the usage of `Logger` in `SmsKapsystemService`. # Test: Search for the usage of `this.logger` in `SmsKapsystemService`. Expect: Proper logging statements. rg 'this.logger' apps/api/src/modules/providers/sms-kapsystem/sms-kapsystem.service.tsLength of output: 195
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 (8)
- apps/api/src/modules/providers/mailgun/mailgun.service.ts (6 hunks)
- apps/api/src/modules/providers/push-sns/push-sns.service.ts (3 hunks)
- apps/api/src/modules/providers/sms-plivo/sms-plivo.service.ts (4 hunks)
- apps/api/src/modules/providers/sms-twilio/sms-twilio.service.ts (4 hunks)
- apps/api/src/modules/providers/smtp/smtp.service.ts (2 hunks)
- apps/api/src/modules/providers/vc-twilio/vc-twilio.service.ts (4 hunks)
- apps/api/src/modules/providers/wa-twilio-business/wa-twilio-business.service.ts (4 hunks)
- apps/api/src/modules/providers/wa-twilio/wa-twilio.service.ts (4 hunks)
Files skipped from review due to trivial changes (1)
- apps/api/src/modules/providers/sms-twilio/sms-twilio.service.ts
Files skipped from review as they are similar to previous changes (7)
- apps/api/src/modules/providers/mailgun/mailgun.service.ts
- apps/api/src/modules/providers/push-sns/push-sns.service.ts
- apps/api/src/modules/providers/sms-plivo/sms-plivo.service.ts
- apps/api/src/modules/providers/smtp/smtp.service.ts
- apps/api/src/modules/providers/vc-twilio/vc-twilio.service.ts
- apps/api/src/modules/providers/wa-twilio-business/wa-twilio-business.service.ts
- apps/api/src/modules/providers/wa-twilio/wa-twilio.service.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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- apps/api/src/common/guards/api-key/api-key.guard.ts (6 hunks)
- apps/api/src/jobs/consumers/notifications/notification.consumer.ts (4 hunks)
- apps/api/src/jobs/producers/notifications/notifications.job.producer.ts (1 hunks)
- apps/api/src/modules/notifications/notifications.service.ts (7 hunks)
Files skipped from review as they are similar to previous changes (3)
- apps/api/src/jobs/consumers/notifications/notification.consumer.ts
- apps/api/src/jobs/producers/notifications/notifications.job.producer.ts
- apps/api/src/modules/notifications/notifications.service.ts
Additional context used
Biome
apps/api/src/common/guards/api-key/api-key.guard.ts
[error] 34-34: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Additional comments not posted (8)
apps/api/src/common/guards/api-key/api-key.guard.ts (8)
29-31
: LGTM!The debug log statement provides useful information for tracking the start of request validation.
35-35
: LGTM!The combined debug log statement improves clarity by reducing the number of log entries.
37-37
: Redundant log statement removed.The redundant log statement for fetching the provider ID has been correctly removed.
52-54
: LGTM!The debug log statement provides useful information for tracking the request header and provider ID in GraphQL requests.
56-56
: Redundant log statement removed.The redundant log statement for fetching the provider ID in GraphQL requests has been correctly removed.
71-71
: LGTM!The debug log statement provides useful information for tracking the start of the
validateApiKeyHeader
method.
82-82
: LGTM!The debug log statement provides useful information for tracking the fetching of the server API key from the request token.
91-93
: LGTM!The debug log statement provides useful information for tracking the fetching of the provider entry from the database.
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)
- apps/api/src/jobs/consumers/notifications/notification.consumer.ts (4 hunks)
- apps/api/src/modules/notifications/notifications.service.ts (7 hunks)
Files skipped from review as they are similar to previous changes (2)
- apps/api/src/jobs/consumers/notifications/notification.consumer.ts
- apps/api/src/modules/notifications/notifications.service.ts
API PR Checklist
Pre-requisites
PR Details
PR details have been updated as per the given format (see below)
feat: add admin login endpoint
)Additional Information
ready for review
should be added if the PR is ready to be reviewed)Description:
Add debug logs wherever there is another method call or values fetched/changed
Allow user to set log level from env file
Related changes:
NA
Screenshots:
NA
Query request and response:
NA
Documentation changes:
NA
Test suite output:
NA
Pending actions:
NA
Additional notes:
NA
Summary by CodeRabbit
New Features
Improvements