Skip to content

feat(contacts): add facebook/ig livestream as a user source - #1697

Merged
sung17 merged 1 commit into
mainfrom
feat/user-source-livestream
Nov 11, 2026
Merged

sung17 merged 1 commit into
mainfrom
feat/user-source-livestream

Conversation

@sung17

@sung17 sung17 commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

{{user_source}} had no value for contacts who first reached a page through a livestream comment. This adds one, and fixes the comment label for TikTok and Threads.

  • New contact source liveComments → {{user_source}} = Facebook/IG Livestream. Set when a first-time commenter's comment is on a Facebook or Instagram live. Ordinary post comments stay Facebook/IG Comment.
  • Live detection moved before contact creation in receiveComment. Before, it ran after the contact was created, so the source could not use it. Facebook still makes the same single getCommentAttachment call (now in lookupMessengerCommentAttachment); Instagram still reads the webhook's isLive.
  • TikTok / Threads comment contacts now show TikTok Comment / Threads Comment instead of the wrong "Facebook/IG Comment". Neither channel has live comments.
  • Contact filter Source picks up the new option automatically; condition.sources.liveComments added to all 21 locale files.

The source is only written when the contact inbox is created, so existing contacts keep their source. ContactInbox.source is a text column, so no migration.

Note

Any flow that compares {{user_source}} to the text "Facebook/IG Comment" for TikTok/Threads contacts will no longer match.

Testing

  • packages/variables: system-fields.test.ts: livestream label, per-channel comment labels
  • apps/worker: received-message.test.ts: Facebook live (via attachment lookup) and Instagram live (webhook flag) create contacts with liveComments
  • apps/builder: contact-filter-config.test.ts
  • pnpm lint, check-types (pre-commit typecheck across 24 packages incl. builder)

🤖 Generated with Claude Code

A first-time commenter on a Facebook or Instagram live is now recorded with
the `liveComments` source, shown as "Facebook/IG Livestream" in
{{user_source}} and offered in the contact filter. Live detection now runs
before the contact is created.

TikTok and Threads comment contacts are labelled "TikTok Comment" and
"Threads Comment" instead of "Facebook/IG Comment".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the feature New feature or request label Nov 11, 2026
@sung17
sung17 merged commit 40e733c into main Nov 11, 2026
15 checks passed
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
A first-time commenter on a Facebook or Instagram live is now recorded with
the `liveComments` source, shown as "Facebook/IG Livestream" in
{{user_source}} and offered in the contact filter. Live detection now runs
before the contact is created.

TikTok and Threads comment contacts are labelled "TikTok Comment" and
"Threads Comment" instead of "Facebook/IG Comment".

Co-authored-by: Deathgiver <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant