Carry the vendor's reason, and send client_id where the trade needs it - #27
Merged
Conversation
…rade needs it Two defects found on the first real Facebook connection, both older than that provider and neither of them in it. Every failure path threw a status and dropped the body, on the token helpers and on the manifest executor alike. So the first connection died on "token endpoint returned 400" and stayed dead: the code is single use and the state row is gone by then, so each diagnosis attempt cost another consent. With the body carried, the next attempt named the cause at once, and so did the two tool calls that failed after it. Read on the failure path only, since a successful body holds the tokens, and bounded so an HTML error page cannot flood a log. tradeUp sent grant_type, the token and client_secret, and never the app id. Threads does not need it; Facebook refuses the call without it, after the code exchange has already succeeded. Verified against the vendor with an invalid token so nothing real was exchanged: without client_id "Missing client_id parameter", with it "Cannot parse access token", which is the endpoint accepting the request and rejecting the fake token. A flag rather than always, because the two Meta trades genuinely differ and Threads has never been run against its vendor. Closes #23 Closes #24
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.
Two defects found on the first real Facebook connection. Both are older than that provider and neither is in it.
The reason was being thrown away. Every failure path threw a status and dropped the body, on the token helpers and on the manifest executor alike. The first connection died on this and stayed dead:
True and useless, and expensive: the code is single use and the state row is gone by then, so every diagnosis attempt costs another consent round trip. With the body carried, the next attempt answered immediately:
and so did the tool calls that failed after it, which turned out to be Meta refusing the endpoint rather than anything this gateway did:
Read on the failure path only, since a successful body holds the tokens, and capped at 400 characters so a vendor answering with an HTML error page cannot flood a log line.
tradeUpnever sentclient_id. It sentgrant_type, the token andclient_secret. Threads does not need the app id, Facebook refuses the call without it, and it refuses after the code exchange has already succeeded, so the consent is spent and the connection ends with no grant.Verified against the vendor with a deliberately invalid token, so nothing real was exchanged:
The second is the endpoint accepting the request and rejecting the fake token.
It is a flag rather than always-on because the two Meta trades genuinely differ, and Threads has never been run against its vendor, so changing what it sends would be a guess stacked on a guess.
After both, a real Facebook connection completes and
get_mereturns real data.Closes #23
Closes #24