Conversation
The database index had to be typed by hand, both in the connection form and again in the browser header, with no way to tell how many databases the server actually has. Both places now use a select instead: - the connection form's 'Select Logical Database' field is a select rather than a numeric input - the browser header replaces its inline number editor with the same select, so the index can be changed without reopening the connection form The options come from the database count reported by the connection test, so they match the server. Until a connection has been tested the default of 16 databases is used as a fallback.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Reviewed by Cursor Bugbot for commit 1d9eca9. Configure here.
| const id = useGenerateId('', ' over db') | ||
|
|
||
| const databasesCount = | ||
| databases && databases > 0 ? databases : DEFAULT_DATABASES_COUNT |
There was a problem hiding this comment.
Form picker uses wrong database count
High Severity
The connection form picker reads databases from connectedInstanceInfoSelector, which is the currently connected instance’s instanceInfo and is never cleared when opening add or edit. A previous connection’s count is used instead of the documented fallback of 16, so the list can omit valid indexes or include ones the target server does not have. Testing another host also merges into that same global field, so a later form still shows the last test’s count.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1d9eca9. Configure here.
| await this.databaseFactory.createDatabaseModel(sessionMetadata, database); | ||
|
|
||
| return; | ||
| return await this.getConnectionInfo(sessionMetadata, database); |
There was a problem hiding this comment.
Info fetch uses unresolved database model
Medium Severity
testConnection discards the model returned by createDatabaseModel and hands the original config to getConnectionInfo. That factory call resolves credentials onto a new object for Azure Entra ID and access-key strategies, so the follow-up client is created without those credentials. The info read is swallowed, and the picker never receives the real database count after a successful test.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1d9eca9. Configure here.


What
The logical database index had to be typed by hand — once in the connection
form, and again in the browser header — with no indication of how many
databases the server actually has.
Both places now use a select:
of a numeric input
so the index can be changed without reopening the connection form
The options come from the database count reported by the connection test
(
databasesin the connection info), so the list matches the server. Until aconnection has been tested, the default of 16 databases is used as a fallback.
Why
Typing the index makes it easy to pick a database that does not exist, and the
UI gives no hint of the valid range.
Changes
api/.../database.service.ts—testConnection()now returns theconnection info instead of
void, so the UI learns the real database count.A private
getConnectionInfo()does the work.api/.../database.controller.ts— the two connection-test endpoints returnthe info.
ui/.../form/DbIndex.tsx—NumericInput→RiSelect.ui/.../instance-header/InstanceHeader.tsx— inline number editor →RiSelect.ui/.../instancesService.ts,ui/.../slices/instances/instances.ts—plumb the connection info through.
Tests
DbIndex.spec.tsx(new, 5 cases): the control is a select rather than aninput, the option count follows the reported database count, and the
fallback is 16 when no connection has been tested.
slices/tests/instances— 176 tests pass.npm run i18n:check,npm run lint:ui,npm run type-check— clean.Screenshots
Connection form with the picker open (db0…db15, no db16):
The same control in the browser header (top left):
Note
Medium Risk
Connection-test API responses now include a JSON body (behavior change for API clients), and the server performs an extra Redis read after each successful test.
Overview
Replaces free-form logical database index entry with select pickers in the connection form and instance header, so users only choose indexes the server actually exposes.
API:
POST /databases/testandPOST /databases/test/:idnow returnRedisDatabaseInfoResponse | nullinstead of an empty body. After a successful test,DatabaseServiceopens a short-lived Redis client viagetConnectionInfo()to read general instance info (especiallydatabases); failures there are logged and returnnullwithout failing the test. Sentinel autodiscovery still returnsnullinstead of throwing.UI:
testInstanceConnectionreturns{ success, data };testConnectionSuccessmerges that payload intoinstanceInfoso the form can size options before save.DbIndexandInstanceHeaderbuilddb0…dbN-1options from reporteddatabases, with 16 as the pre-test default. The header uses pending state on the select whilecheckDatabaseIndexActionruns.Tests: New
DbIndex.spec.tsx; instances slice tests updated for the newtestConnectionSuccesspayload.Reviewed by Cursor Bugbot for commit 1d9eca9. Bugbot is set up for automated code reviews on this repo. Configure here.