Skip to content

Answer a BluMint close of a key the bridge holds nothing under with 200 - #99

Merged
Confetti3 merged 1 commit into
Confetti3:nightlyfrom
BluMintInc:blumint/close-unknown-key-200
Oct 17, 2026
Merged

Confetti3 merged 1 commit into
Confetti3:nightlyfrom
BluMintInc:blumint/close-unknown-key-200

Conversation

@oconnorjoseph

Copy link
Copy Markdown

BluMint treats a close answered 404 as a failed close and hands the match to a host. Its contract says that when a partner holds nothing under a close's idempotencyKey, it records the key closed and answers 200, so a later creation under that key is refused. The bridge answered 404 { "code": "unknown_match" } for that case, and again on every repeat.

What changes

  • A close for a key the bridge holds nothing under, for that connection, still marks the key closed, and now answers 200 { "closed": true }, the same as a close of a match that is already over. A repeat answers the same.
  • Every other close is unchanged: a live match closes, an ended match answers 200, and a later creation under a closed key answers 409 key_reused.
  • Since a close no longer needs to know whether a key only had refused creations, blumint_refused_keys and the code that kept it are removed, and migration 026 drops the table.

Tests

tests/blumint.rs: a_closed_match_sends_nothing and a_close_naming_another_connections_key_ends_nothing now expect 200 { "closed": true } where they expected 404 unknown_match. Against nightly's code both fail with left: (404, {"code": "unknown_match"}), right: (200, {"closed": true}). With the fix, cargo fmt --check, cargo clippy --locked --workspace --all-targets -- -D warnings and cargo test --locked (300 tests) pass.

Docs

  • docs/guides/BLUMINT_QUICKSTART.md: the close section says a key that made no match stays closed for a day after its close, and that a close of a key the bridge holds nothing under answers as a match that already ended does. The 404 unknown_match row is gone from the close table, and the 200 row now covers a key with no match, whether its creations were refused or none arrived.
  • docs/guides/INTEGRATIONS.md: the close bullet says such a key answers 200 and is closed all the same.

BluMint reads a close answered 404 as a failed close and hands the match
to its host. Its contract says a partner that holds nothing under the
close's idempotencyKey records the key closed and answers 200, so a later
creation under it is refused. The bridge answered 404 unknown_match for
that case, and again on every repeat.

Such a close now marks the key closed, as before, and answers
{ "closed": true }, as a close of a match already over does. A live match
still closes, an ended one still answers 200, and a later creation under a
closed key still answers 409 key_reused.

Nothing reads which keys had only refused creations any more, so
blumint_refused_keys is dropped (migration 026) along with the code that
kept it.
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.

2 participants