Skip to content

fix(social-accounts): classify Graph capability errors as unrecoverable by retry or reconnect - #146

Closed
murtaja1 wants to merge 1 commit into
brightbeanxyz:mainfrom
Murtaja-Adnan:pr/webhook-capability-copy
Closed

fix(social-accounts): classify Graph capability errors as unrecoverable by retry or reconnect#146
murtaja1 wants to merge 1 commit into
brightbeanxyz:mainfrom
Murtaja-Adnan:pr/webhook-capability-copy

Conversation

@murtaja1

Copy link
Copy Markdown

Meta's (#3) Application does not have the capability to make this API call (Graph error code 3, HTTP 400) on POST /{ig-user-id}/subscribed_apps is an app-access-tier gate, not a token problem. Currently it lands in the _REJECTED bucket, 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_comments included) 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_gate check (code 3, dict-shaped Graph error) short-circuits classify_webhook_failure into a new WEBHOOK_CAPABILITY_MESSAGE naming the actual cause, with needs_reconnect=False. _classify itself 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.py pass (56 tests).

…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.
@murtaja1
murtaja1 requested a review from JanSchm as a code owner August 11, 2026 12:52
@Murtaja-Adnan Murtaja-Adnan closed this by deleting the head repository Aug 14, 2026
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