Skip to content

fix(bridge): omit Idempotency-Key on the plaid public_token exchange#456

Merged
islandbitcoin merged 1 commit into
mainfrom
fix/bridge-plaid-exchange-idempotency
Jul 18, 2026
Merged

fix(bridge): omit Idempotency-Key on the plaid public_token exchange#456
islandbitcoin merged 1 commit into
mainfrom
fix/bridge-plaid-exchange-idempotency

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

Bug

Found live on the first production Plaid link via flash-mobile#668: after the user completes Plaid Link, bridgeExchangePlaidPublicToken fails and the app shows "Cannot set Idempotency-Key on this request, either because the POST method does not support it or it is explicitly disabled for this particular resource."

BridgeClient.request() auto-attaches Idempotency-Key to every non-GET/DELETE call, but Bridge explicitly disables the header on /plaid_exchange_public_token/{linkToken} (the exchange is inherently idempotent per one-time link token) and 400s when it's present. Every exchange — i.e. every Plaid link — fails server-side even though Plaid's own UI reports success. No released clients affected (only the unreleased #668 branch calls the exchange), but it blocks the mobile release.

Fix

request() accepts idempotencyKey: null meaning "this endpoint does not take the header" (undefined still auto-generates a UUID); exchangePlaidPublicToken passes null, with a comment carrying the Bridge error text for the next reader.

Verification

  • New tests: the exchange POST carries no Idempotency-Key; createPlaidLinkRequest still auto-generates one (distinct one-time tokens).
  • Full unit suite green, tsc-check clean.
  • After deploy: relink a bank via flash-mobile#668 → exchange succeeds → external account provisions via webhook.

🤖 Generated with Claude Code

Bridge explicitly disables the header on
/plaid_exchange_public_token/{linkToken} (the exchange is already
idempotent per link token) and rejects requests carrying it with 400
"Cannot set Idempotency-Key on this request" — every production Plaid
exchange failed, found live on the first flash-mobile#668 device test.

request() now accepts idempotencyKey: null to mean "endpoint does not
take the header" (undefined still auto-generates), and the exchange
passes null. Tests pin both: exchange POST carries no header,
link-token request still auto-generates one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@islandbitcoin
islandbitcoin merged commit 38557f2 into main Jul 18, 2026
15 checks passed
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