Skip to content

Allow connection deletion when connection is invalid#2353

Merged
MarceloRGonc merged 2 commits into
mainfrom
mg/OPS-4537
Jun 18, 2026
Merged

Allow connection deletion when connection is invalid#2353
MarceloRGonc merged 2 commits into
mainfrom
mg/OPS-4537

Conversation

@MarceloRGonc

Copy link
Copy Markdown
Contributor

Fixes OPS-4537

Copilot AI review requested due to automatic review settings June 18, 2026 07:59
@linear

linear Bot commented Jun 18, 2026

Copy link
Copy Markdown

OPS-4537

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts app-connection deletion to work even when a stored connection can’t be decrypted/refreshed, by fetching only the minimal DB metadata needed for telemetry before deleting.

Changes:

  • Update DELETE /app-connections/:id to fetch connection metadata (instead of fully decrypting the connection) before deletion.
  • Add appConnectionService.getMetadataOrThrow to retrieve { projectId, authProviderKey } without decrypt/refresh.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/server/api/src/app/app-connection/app-connection.controller.ts Uses getMetadataOrThrow for delete flow to avoid failing deletion on invalid connections while still emitting telemetry.
packages/server/api/src/app/app-connection/app-connection-service/app-connection-service.ts Adds getMetadataOrThrow to fetch minimal connection fields without decryption/refresh.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add tests covering:
- Happy path returning id, projectId, and authProviderKey
- ENTITY_NOT_FOUND error when connection does not exist
- Regression test proving metadata retrieval works even when
  decryption would fail

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@MarceloRGonc MarceloRGonc merged commit 479b7f5 into main Jun 18, 2026
21 checks passed
@MarceloRGonc MarceloRGonc deleted the mg/OPS-4537 branch June 18, 2026 08:48
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.

3 participants