Skip to content

fix(seed): refuse an inline connection whose type or name is not a string, on every route - #2247

Merged
cevheri merged 6 commits into
mainfrom
fix/inline-connection-type-and-name
Nov 4, 2026
Merged

cevheri merged 6 commits into
mainfrom
fix/inline-connection-type-and-name

Conversation

@cevheri

@cevheri cevheri commented Nov 4, 2026

Copy link
Copy Markdown
Member

Closes D454. An inline connection whose type is missing, empty or not a string, or whose name is present and not a string (null included), now answers 400 Valid connection configuration is required (CONFIG_ERROR) on every route that takes a caller's connection. Before, most routes answered 500 with a runtime TypeError (e.replace is not a function, Cannot read properties of undefined), a few answered 400 with no code, and a null name was built as a nameless connection.

The check lives once in resolveConnection, which every such route passes through, so POST /api/db/statement/analyze drops its own copy. The route-level type checks this makes unreachable are filed as D455 rather than removed here.

Measured on a production build: 8 kinds of bad record against 24 routes plus fleet-health and the two bare-connection routes. Before, 88 unhandled errors in the log; after, 400 everywhere and none. Gate set green, coverage 100%.

…ring

resolveConnection now refuses an inline record whose type is missing,
empty or not a string, or whose name is present and not a string (null
included), with 400 CONFIG_ERROR "Valid connection configuration is
required", before any route builds a provider.

Before this, the factory and the cache key read both fields with string
methods, so every route but the statement analysis answered such a
record 500 with the runtime's TypeError, or built a null name as an
empty one. The new route test sends the records to every connection
route in the inventory, the disconnect route and the fleet health
check.
resolveConnection now refuses the same inline records, a type that is
missing or not a string and a name that is present and not a string,
before this route reads its fields, and every other source of a
resolved connection passes the seed schema, so the route's copy of the
check could no longer be reached.
…close D454

The query section of docs/API_DOCS.md now says which inline records
every connection route refuses with 400 CONFIG_ERROR, and the statement
analysis error table lists the sentence among the connection errors
every database route answers. The work D454 asked for has landed, so
its entry leaves the backlog.
…oes not reach

The disconnect route reads the record's id before it resolves anything and resolves a record only without governance, so a connection that is not an object or has no id answers its own envelope, and governance answers 200. Tests pin both.
@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@cevheri
cevheri merged commit 42d87c5 into main Nov 4, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant