fix(bridge): omit Idempotency-Key on the plaid public_token exchange#456
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Found live on the first production Plaid link via flash-mobile#668: after the user completes Plaid Link,
bridgeExchangePlaidPublicTokenfails 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-attachesIdempotency-Keyto 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()acceptsidempotencyKey: nullmeaning "this endpoint does not take the header" (undefinedstill auto-generates a UUID);exchangePlaidPublicTokenpassesnull, with a comment carrying the Bridge error text for the next reader.Verification
Idempotency-Key;createPlaidLinkRequeststill auto-generates one (distinct one-time tokens).tsc-checkclean.🤖 Generated with Claude Code