iachat/app/javascript/dashboard
Muhsin Keloth 939471cb3b
fix: Prevent duplicate conversations in conversation list (#13713)
Agents using API channel inboxes (e.g., WhatsApp Automate) reported
seeing the same conversation appear twice in their conversation list —
one showing the last message preview and the other showing "No
Messages". Backend investigation confirmed no duplicate conversations
exist in the database, making this purely a frontend issue.

The root cause is a race condition in WebSocket event delivery. When a
conversation is created via the API with auto-assignment, the backend
enqueues multiple ActionCable broadcast jobs (`conversation.created`,
`assignee.changed`, `team.changed`) within milliseconds of each other.
In production with multi-threaded Sidekiq workers, these events can
arrive at the frontend out of order. If `assignee.changed` arrives
before `conversation.created`, the `UPDATE_CONVERSATION` mutation pushes
the conversation into the store (since it doesn't exist yet), and then
`ADD_CONVERSATION` blindly pushes it again — resulting in a duplicate
entry.

The fix adds a uniqueness check in the `ADD_CONVERSATION` mutation to
skip the push if a conversation with the same ID already exists in the
store, matching the dedup pattern already used by
`SET_ALL_CONVERSATION`.
2026-03-06 14:07:02 +04:00
..
api feat(help-center): enable drag-and-drop category reordering (#13706) 2026-03-05 12:53:38 +05:30
assets chore: Remove vue-multiselect package and styles from codebase (#13585) 2026-02-19 15:42:34 +05:30
components feat: Add natural language date parser for snooze functionality (#13587) 2026-03-06 12:20:22 +04:00
components-next feat(help-center): enable drag-and-drop category reordering (#13706) 2026-03-05 12:53:38 +05:30
composables chore: Remove vue-multiselect and migrate to next components (#13506) 2026-02-17 16:40:12 +05:30
constants feat: Add a priority + created at sort for conversations (#13658) 2026-02-25 18:22:41 -08:00
helper feat: Add natural language date parser for snooze functionality (#13587) 2026-03-06 12:20:22 +04:00
i18n feat: Add natural language date parser for snooze functionality (#13587) 2026-03-06 12:20:22 +04:00
mixins feat: allow configuring attachment upload limit (#12835) 2025-11-17 14:03:08 -08:00
modules feat: compose form improvements (#13668) 2026-03-02 18:27:51 +05:30
routes feat: Add natural language date parser for snooze functionality (#13587) 2026-03-06 12:20:22 +04:00
store fix: Prevent duplicate conversations in conversation list (#13713) 2026-03-06 14:07:02 +04:00
stores feat: Voice Channel (#11602) 2025-12-19 12:41:33 -08:00
App.vue chore: Remove vue-multiselect package and styles from codebase (#13585) 2026-02-19 15:42:34 +05:30
featureFlags.js chore: make all the deprecated feature flag reclaimable (#13646) 2026-02-26 18:01:13 +05:30