Skip to content

fix(credentials): clean up personal secrets in archived workspaces - #7882

Merged
icecrasher321 merged 2 commits into
stagingfrom
codex/fix-personal-secret-cleanup
Sep 16, 2026
Merged

icecrasher321 merged 2 commits into
stagingfrom
codex/fix-personal-secret-cleanup

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Remove deleted personal-secret credential records across all workspaces, including archived workspaces and workspaces the user can no longer access.
  • Reconcile against the current secret map under its lock, so delayed saves cannot remove records for newer secrets. Continue creating records only in active workspaces.
  • Make the MCP discovery timeout test deterministic with a fake clock.

Type of Change

  • Bug fix

Testing

  • 102 tests across the credential and environment regression suites.
  • 25 MCP client tests, including the discovery timeout regression.
  • App type-check, repository lint, block-registry check, repository audits, and docs-manifest check.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 16, 2026 6:37pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no outstanding correctness, security, or repository-rule issues identified.

Summary

This PR reconciles personal-secret credential mirrors against the current environment map while holding the appropriate locks.

  • Removes deleted personal-secret credential records from archived and inaccessible workspaces.
  • Continues creating credential mirrors only for active workspaces.
  • Re-reads the environment map under lock to prevent delayed saves from pruning newer secrets.
  • Makes the MCP timeout assertion deterministic by freezing time within the relevant test.
Diagram
sequenceDiagram
  participant Caller
  participant Sync as Credential reconciliation
  participant DB as Database
  Caller->>Sync: Sync personal environment credentials
  Sync->>DB: Begin transaction
  Sync->>DB: Lock personal environment map
  Sync->>DB: Acquire user identity fence
  Sync->>DB: Read current secret keys
  Sync->>DB: Delete obsolete user-owned mirrors globally
  alt Current keys and active workspaces exist
    Sync->>DB: Create missing active-workspace mirrors
    Sync->>DB: Restore owner memberships
  end
  DB-->>Sync: Commit
Loading

Reviews (2) · Last reviewed commit: "fix(mcp): use a deterministic clock for ..."

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321
icecrasher321 merged commit 04aae63 into staging Sep 16, 2026
34 checks passed
@icecrasher321
icecrasher321 deleted the codex/fix-personal-secret-cleanup branch September 16, 2026 18:55

This branch was previously deployed

1 inactive deployment
Preview e681bce4 Deployed Sep 16, 2026 by vercel[bot]
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