fix(webui): Apply direct MongoDB replica connection as in #1518 to resolve dev-env startup issue.#1598
Conversation
WalkthroughA MongoDB connection URL parameter is appended to the autoConfig method to include Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (1)📓 Common learnings🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| return { | ||
| forceClose: true, | ||
| url: `mongodb://${settings.MongoDbHost}:${settings.MongoDbPort}/${settings.MongoDbName}`, | ||
| url: `mongodb://${settings.MongoDbHost}:${settings.MongoDbPort}/${settings.MongoDbName}?directConnection=true`, |
There was a problem hiding this comment.
do we know if it affects oplog tailing (e.g., Collection.watch())?
if we can't easily gain confidence that there's no effect, would it be better if we enable it only in the development environment? we can expose a settings.MongoDbDirectConnection with default value as false. then we can set it as true in controller.py
alternatively, we can follow the suggestions at https://www.mongodb.com/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.directConnection about "configuring the cluster to make each MongoDB instance accessible outside of the Docker virtual network", although i haven't investigated what's needed for our Docker Compose setup. (maybe simply adding another hostname when calling rs.initReplicaSet:
)
junhaoliao
left a comment
There was a problem hiding this comment.
deferring to @hoophalab 's review
…to resolve dev-env startup issue. (y-scope#1598)
Description
Moving to docker compose introduced a bug that prevented connection to mongo database when running dev (no bug when actually running package). #1518 provided a fix, but not for webui. Adding fix for webui.
Checklist
breaking change.
Validation performed
Can connect with dev launch command
Summary by CodeRabbit