Skip to content

feat(instagram): coexist history sync for native Instagram - #912

Merged
viethung0o0 merged 3 commits into
mainfrom
feat/instagram-coexist
Aug 8, 2026
Merged

feat(instagram): coexist history sync for native Instagram#912
viethung0o0 merged 3 commits into
mainfrom
feat/instagram-coexist

Conversation

@viethung0o0

Copy link
Copy Markdown
Contributor

Summary

Adds a coexist option for the native Instagram channel, matching the existing Messenger and WhatsApp coexist behavior. When enabled after connecting an Instagram account, existing Instagram Direct conversations and recent message history are imported into the inbox while live messages continue to flow.

Scope

  • Enable/disable coexist for native Instagram (type: "instagram" only; instagram-facebook is unaffected).
  • Background sync imports contacts and recent message history idempotently, with resumable progress and bounded concurrency.
  • Coexist state access moved behind a repository + business service; Messenger and WhatsApp coexist behavior is preserved.
  • Instagram message history is limited to what Meta exposes (20 most recent messages per conversation); the feature does not promise full history.

Notes

  • Includes a database migration (enum value + coexistEnabled column). Apply on deploy.
  • Pre-run quota gating for large imports is left as a follow-up product decision.

Test plan

  • pnpm lint on changed files
  • Type-check: database, worker, builder
  • Unit/integration tests: coexist repository, service, Instagram sync, adapters, scheduler dispatch, attachment download
  • Messenger + WhatsApp coexist tests remain green (no regression)
  • Verify end-to-end after migration is applied in staging

@viethung0o0
viethung0o0 marked this pull request as ready for review August 8, 2026 03:08
@viethung0o0
viethung0o0 merged commit 01eb17c into main Aug 8, 2026
8 checks passed
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.

2 participants