Skip to content

Hybrid: abandoned broker sign-ins expire after a day - #316

Merged
nambok merged 1 commit into
mainfrom
fix/hybrid-signin-ttl
Oct 26, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/hybrid-signin-ttl

Conversation

@nambok

@nambok nambok commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Since #309, the hosted broker finishes a Notion, Confluence or Google Drive sign-in in a holding partition and moves it to the install only when the install redeems the code. Nothing removed a sign-in that was never redeemed, so its server and token records stayed for good. This PR has them expire after a day.

Changes

  • common/src/mcp_remote/store.rs: HOLDING_MARKER (#SIGNIN#), HOLDING_TTL_SECS (one day) and holding_expiry(team, now). ServerRecord::to_item and TokenRecord::to_item write ttl only when the team key is a holding partition. Pending sign-ins already carried their own ten-minute ttl. A team's own records never get one, and records moved into an install's partition are written without it.
  • gateway/src/routes/hybrid.rs: signin_team builds its key from HOLDING_MARKER, so the two can't drift apart.
  • infra/lib/database-stack.ts: only the comment changes. The MCP configs table's TTL attribute is already ttl.

Verification

  • New test holding_partitions_expire_and_nothing_else_does. It failed with the ttl writes removed and passes with them. a_provider_sign_in_is_held_apart_from_the_install now also checks that the holding key expires and the install's own key doesn't.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (workspace), infra npm test.

The hosted broker finishes a provider sign-in in a holding partition and
moves it to the install when the install redeems the code. A sign-in that
is never redeemed left its server and token records behind for good. Server
and token records in a holding partition (a team key with
store::HOLDING_MARKER) now carry a ttl a day out on the MCP configs table,
whose TTL attribute is already ttl; a team's own records never do.
@nambok
nambok merged commit 662d63c into main Oct 26, 2026
8 checks passed
@nambok
nambok deleted the fix/hybrid-signin-ttl branch October 26, 2026 21:07
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