Repository navigation
Read only the type and credential when updating a connector - #1627
Merged
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Saving a connector (for example
PUT /api/connectors/:id/env-vars) loaded the whole connector twice, with every tool, resource and prompt. Sentry flagged it as an N+1 query (ANYTHINGMCP-CLOUD-BACKEND-E, sampled on 11-10). The second load is inConnectorsService.update(), which only needs the connector's type and its stored credential.Changes
update()reads{ type, authConfig }with aselectinstead of callingfindById(which includes tools, resources, prompts and server links).NotFoundException.Type
Testing
connectors.service.auth-status.spec.tschecks the narrowselectand the 404 for an unknown id; the existing auth-status and bearer tests still cover whatexistingis used for.Backend CI runs the suite (the local Prisma client in my checkout is out of date).
Checklist
npm test) (in CI)Cloud and self-hosted behave the same; no API or schema change.
Related Issues
Sentry ANYTHINGMCP-CLOUD-BACKEND-E