-
Notifications
You must be signed in to change notification settings - Fork 6
fix(csi-1938): updated deps #39
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR updates various dependencies and refactors MongoDB and Kafka service implementations to improve connection management, error handling, and logging. The changes include upgrading to snapshot versions of key dependencies and restructuring how MongoDB connections are maintained throughout the application lifecycle.
- Refactored MongoDB service to maintain a persistent connection instead of creating/closing connections for each operation
- Updated Kafka service to use the new Consumer API from
@mojaloop/central-services-stream - Improved logging throughout the application using child loggers with component context
- Added UUID to BSON conversion for MongoDB document IDs
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/services/event-processor.service.test.js | Added async/await to initialize test and fixed trailing whitespace issues |
| src/services/mongo-db.service.js | Refactored to use persistent MongoDB connection, added event listeners, improved error handling and logging |
| src/services/kafka.service.js | Updated to use new Consumer API and added logging for consumer startup |
| src/services/event-processor.service.js | Refactored message handling into separate parseOneEvent method, added uuidToBson conversion, improved error logging |
| src/lib/config.js | Standardized format strings, improved code formatting and consistency |
| src/index.js | Reordered imports, improved logging messages, added await for eventProcessor initialization |
| package.json | Updated multiple dependencies including central-services packages, added snapshot version with overrides |
| eslint.config.js | Added Jest globals to ESLint configuration |
| docker-compose.yaml | Updated Kafka image to bitnamilegacy, changed topic name, added LOG_LEVEL environment variable |
| Dockerfile | Commented out test directory copy in build stage |
| CODEOWNERS | Added new code owner @geka-evk |
| .ncurc.yaml | Added configuration for npm-check-updates with rejection reasons for specific packages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| logger.error(message, err) | ||
| } finally { | ||
| await mongo.close() | ||
| this.log.error('Failed to initialize MongoDB Service: ', err) |
Copilot
AI
Nov 24, 2025
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.
Potential resource leak: If the MongoDB connection fails during initialization (lines 19-36), the mongoClient connection is not closed. The old code had a finally block that ensured the connection was closed after initialization. Consider adding cleanup logic in the catch block to close the connection if initialization fails:
} catch (err) {
this.log.error('Failed to initialize MongoDB Service: ', err)
if (this.mongoClient) {
await this.mongoClient.close()
this.mongoClient = null
}
}| this.log.error('Failed to initialize MongoDB Service: ', err) | |
| this.log.error('Failed to initialize MongoDB Service: ', err) | |
| if (this.mongoClient) { | |
| await this.mongoClient.close() | |
| this.mongoClient = null | |
| } |
|


No description provided.