Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 109202785e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let argAndRest = try extractParenthesizedArgAndRemainder(from: input, startingAt: parenIndex) | ||
| let arg = argAndRest.arg |
There was a problem hiding this comment.
Reject trailing tokens in db-level method parsing
parseDbLevelMethod parses the parenthesized argument but ignores the returned remainder, so malformed input like db.dropDatabase()foo is accepted and executed as a real dropDatabase command instead of throwing syntax error. This is especially dangerous for destructive db-level operations introduced in this change, because a typo after ) can still run the command.
Useful? React with 👍 / 👎.
| func forceLoadTables() { | ||
| loadTask?.cancel() | ||
| loadTask = nil | ||
| isLoading = false | ||
| loadTables() |
There was a problem hiding this comment.
Prevent canceled table loads from overwriting fresh sidebar data
forceLoadTables() cancels the previous task and immediately starts a new load, but the canceled task is not awaited and loadTablesAsync() has no cancellation guard before writing tables. If the first fetch completes after the replacement fetch (e.g., during MongoDB database switching), stale results can overwrite the newly loaded table list and reintroduce the wrong sidebar state.
Useful? React with 👍 / 👎.
Summary
system.version) being misparsed in shell syntaxdb["collection"]) support and db-level method handling to MongoShellParserChanges
Database switch fix
MongoDBDriver.connectionchanged fromlettoprivate(set) varwithswitchDatabase(to:)method.refreshDatanotification post (matching PostgreSQL branch)SidebarViewModelusesforceLoadTables()from notifications to prevent race conditions with stale schemaProvider cacheDotted collection name support
.before first(instead of first., sodb.system.version.find()correctly parses as collection=system.versiondb["collection"]across MongoDBStatementGenerator, TableOperations, QueryTab, ExportService, and MongoDBDriver DDLShell parser improvements
parseBracketExpression()fordb["collection"].method()syntaxparseDbLevelMethod()fordb.getCollectionNames(),db.listCollections(),db.createCollection(),db.dropDatabase(),db.version(),db.stats()db.with empty collection nameTest plan
system.version), verify CRUD operations work