-
Notifications
You must be signed in to change notification settings - Fork 3
Comments on boosted posts never match the organic post's rule #34
Copy link
Copy link
Open
Labels
area: automationTriggers, keywords, DM content, delivery behaviourTriggers, keywords, DM content, delivery behaviourarea: instagram-apiMeta Graph API surface, webhooks, OAuthMeta Graph API surface, webhooks, OAuthbugSomething isn't workingSomething isn't workingeffort: smallA focused change, roughly an eveningA focused change, roughly an eveningroadmapA planned feature from the README roadmapA planned feature from the README roadmap
Description
Metadata
Metadata
Assignees
Labels
area: automationTriggers, keywords, DM content, delivery behaviourTriggers, keywords, DM content, delivery behaviourarea: instagram-apiMeta Graph API surface, webhooks, OAuthMeta Graph API surface, webhooks, OAuthbugSomething isn't workingSomething isn't workingeffort: smallA focused change, roughly an eveningA focused change, roughly an eveningroadmapA planned feature from the README roadmapA planned feature from the README roadmap
The bug
When you boost a post, comments left on the ad carry the ad's media id, not the original post's. A rule scoped to the organic post silently stops matching for exactly the traffic you paid to acquire.
The rule looks correct, the comment arrives, and nothing sends.
Why it happens
src/process.tsreads the media id from the webhook and hands it tofindMatchingRule, which compares againstrules.media_id:For an ad comment, that value is the ad's media id. The rule's is the organic post's. They never match.
The fix
Meta includes
original_media_idon ad comments. Capture it and match against either id.findMatchingRuleshould accept both and treat a rule as post-scoped-matching if it matches either. Prefer the original id when both are present, since that is the one a user would have selected in the picker.Acceptance criteria
original_media_idparsed from the comment payloadWhere to look
src/process.ts— theCommentValuetype andprocessCommentsrc/match.ts—findMatchingRulescripts/test-unit.tsHard to test without a live boosted post, so a well-constructed fixture payload is the deliverable. Note it in the PR.