Repository navigation
Conversation
kmcginnes
force-pushed
the
safer-connection-import-and-types
branch
from
October 9, 2026 17:40
7c7c0c6 to
76dccbe
Compare
This branch has not been deployed
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.
Summary
Importing a connection file with an unrecognized
serviceType(or a non-stringawsRegion) quietly dropped the value but left IAM on, so requests were then signed for theneptune-dbdefault, a service the file never named. This PR also tightens a few connection types along the way.mapToConnectionreturnsSavedConnection & { connection: ConnectionConfig }, so theas SavedConnectioncast is gone.fetchDefaultConnectionnow declaresPromise<SavedConnection[]>as its return type.queryEngineSelectoronly falls back to"gremlin"when there is no active connection, becausenormalizeConnectionalready guarantees a query engine.Evidence
Before: a file with
awsAuthEnabled: trueandserviceType: "not-a-real-service-type"imported with IAM still on and noserviceType.After: new tests in
parseConnectionFile.test.ts:The same cases run against the legacy
urlshapes older builds wrote (urlonly, andurl+graphDbUrl, both withproxyConnection: true), andurlandproxyConnectionsurvive.New golden imports in
connectionFileGoldenFiles.test.tspin connection files with IAM fields as shipped builds wrote them:connection-file-v1.5-iam-without-service-type.json: written beforeserviceTypeexisted. IAM stays on, because an absent field is not an invalid one.connection-file-v3.2.2-iam-proxy.json: a v3.2.2 proxy connection with IAM. Everything is kept.connection-file-v3.2.2-proxy-iam-off.json: v3.2.2 form defaults (awsRegion: "",serviceType: "neptune-db", IAM off). An empty region is not treated as invalid.Verified live: imported connection files through the UI in Safari, then checked the stored connection in IndexedDB. A bad service type or a numeric region imported with IAM off and logged the warning. Valid and missing values imported unchanged, and a file with no endpoint still showed the "Invalid File" toast.
Merge Danger
Door: two-way
Impact: narrow
Only imports whose
awsRegionorserviceTypefails validation change, and those now come in with IAM off. Files that Graph Explorer exported always contain valid values, the existing golden-file and backward-compatibility tests pass unchanged, and new golden files pin the IAM shapes v1.5 and v3.2.2 wrote.Related