fix(social-accounts): classify Graph capability errors as unrecoverable by retry or reconnect - #146
Closed
murtaja1 wants to merge 1 commit into
Closed
Conversation
…le by retry or reconnect Meta's (#3) 'Application does not have the capability' (error code 3) on POST /{ig-user-id}/subscribed_apps is an app-access-tier gate: a reconnect issues a same-tier token and a retry replays the same call, so the REJECTED bucket's 'Try again' offer and any reconnect advice are both dead ends (verified against production: a fresh token with every scope granted still got code 3). Give it its own classification and copy that names the real remedy: elevated platform access.
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.
Meta's
(#3) Application does not have the capability to make this API call(Graph error code 3, HTTP 400) onPOST /{ig-user-id}/subscribed_appsis an app-access-tier gate, not a token problem. Currently it lands in the_REJECTEDbucket, so the account card offers Try again — but a retry replays the same call and a reconnect issues a same-tier token; neither can ever succeed.Verified against production: token debug showed every needed scope granted (
instagram_manage_commentsincluded) on a valid Page token, reconnect changed nothing, and the raw call kept returning code 3. The real remedy is Advanced Access for the relevant permission.Fix: a
_is_capability_gatecheck (code 3, dict-shaped Graph error) short-circuitsclassify_webhook_failureinto a newWEBHOOK_CAPABILITY_MESSAGEnaming the actual cause, withneeds_reconnect=False._classifyitself is untouched, so health-check / publish / first-comment translations are unaffected.Tested: new unit test with the production payload shape;
test_error_messages.py+test_webhook_subscription.pypass (56 tests).