Skip to content

Instagram comment automation silently never replies (two separate bugs) #863

Description

@peetorres

Self-hosted, community edition, Instagram Business Login. App published, webhook verified, account connected, permissions granted.

Incoming comments create the contact and the inbox message correctly, but a private reply is never delivered — and nothing is logged as an error. Two independent bugs, either of which is enough to produce complete silence.

1. Comment automations are always stored with type = messenger

FBCommentAutomation.type has messenger as its column default, and the create form at /fb-comments/create never exposes a channel selector, so every automation is saved as messenger.

The worker resolves automations using the channel derived from the incoming event:

const channelType = integrationType;              // "instagram"
const automations = await fbCommentAutomationService
  .findActiveAutomations({ workspaceId, channelType });

For an Instagram comment this never matches, so the loop body never runs and no log line is emitted. The enum already accepts instagram, so the workaround is:

UPDATE "FBCommentAutomation" SET type = 'instagram' WHERE id = '...';

Passing ?type=instagram on the create URL has no effect.

2. Text private replies are Messenger-only

In executePrivateReply:

if (privateReply.type === "text" && privateReply.value) {
  if (ctx.channelType === "messenger") await sendPrivateReply(...);
  return;                       // instagram returns here, sending nothing
}

On Instagram the function returns without sending and without throwing. Because no exception reaches the caller, dispatchFailed stays false, so the dedup row is inserted and repliesCount is incremented — the UI reports replies that never left the server. Confirmed by an empty chat queue and zero outgoing rows in Message.

The flow and AIAgent branches enqueue a job for any channel, so setting the private reply to a Flow works around this.

Suggested fixes

  1. Expose the channel on the automation form (or infer it from the connected channel), and/or filter with the correct type when the workspace only has Instagram connected.
  2. Either implement the Instagram path for text private replies, or make the unsupported combination fail loudly instead of silently succeeding — the silent success is what makes this hard to diagnose.

Happy to open a PR for either one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions