Repository navigation
fix(seed): refuse an inline connection whose type or name is not a string, on every route - #2247
Merged
Merged
Conversation
…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.
…nection made unreachable
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes D454. An inline connection whose
typeis missing, empty or not a string, or whosenameis present and not a string (nullincluded), now answers 400Valid 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 anullname was built as a nameless connection.The check lives once in
resolveConnection, which every such route passes through, soPOST /api/db/statement/analyzedrops 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%.