Conversation Merge Rules with the Inbox
Per checklist line 312 'DM/comment assignment': once the Facebook / Instagram channels are checked, DMs + comments from the same user merge to one agent.
- Same-person merge — DMs and comments from the same user on FB/INS merge into one customer profile by channel user ID; the inbox shows a single conversation.
- Same assignee — Per checklist line 312: once the Facebook / Instagram channels are checked, DM+comment conversations from the same user are assigned to the same agent, never split.
- Comment to DM — When a public comment needs a deeper talk, the agent moves it to DM in one tap; the original comment stays in the conversation timeline for context.
- Message dedup — Each message is stored uniquely by its Meta message mid (ON CONFLICT DO NOTHING); webhook retries never create duplicates.
Inbox integration: after this module stores messages, the inbox aggregates conversations by (tenant_id, channel, sender_psid); the agent side needs no change to see merged conversations.
Table Design →