iachat/app
Pranav b5deac468e
fix: Fix duplicate contact inbox race condition (#11139)
This PR addresses a race condition in the contact inbox model caused by
duplicate `source_id` values linked to different contacts.

The issue typically occurs when an agent updates a contact’s email or
phone number or when two contacts are merged. In these scenarios, the
`source_id`, which is intended to uniquely identify the contact in a
session, may still be associated with the old contact inbox.

To solve this, we check if there’s already a ContactInbox with the same
source_id but linked to another contact. If we find one, we update that
old record by changing its source_id to a random value. This breaks the
wrong connection and prevents issues, while still keeping the old data
safe.

However, this is only a temporary fix. The main issue is with the way
the contact inbox model is designed. Right now, it’s being used to track
sessions, but that may not be necessary for non-live chat channels. In
the long run, we should consider redesigning this part of the system to
avoid such problems.
2025-03-20 18:24:28 -07:00
..
actions chore: Avoid contact inboxes getting deleted (#10612) 2024-12-26 16:17:38 +05:30
assets chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
builders fix: Fix duplicate contact inbox race condition (#11139) 2025-03-20 18:24:28 -07:00
channels fix: Move contact events to account stream rather than individual user stream (#11082) 2025-03-13 17:46:48 -07:00
controllers feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
dashboards feat: Add the ability to filter items in Super Admin panel (#11020) 2025-03-05 16:32:54 -08:00
dispatchers feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
drops feat: Add the support for custom attributes in message variables (#8511) 2023-12-08 14:13:35 -08:00
fields feat: setup captain limits (#10713) 2025-01-23 01:23:18 +05:30
finders feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
helpers feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
javascript fix: Duplicate action being sent when we click on save contact (#11138) 2025-03-20 14:36:31 -07:00
jobs feat: discard Twilio events when Body parameter is not present (#11096) 2025-03-17 12:47:11 +05:30
listeners chore: Ignore notification when assignee is nil (#11105) 2025-03-18 20:14:19 -07:00
mailboxes fix: Process non-image inline attachments as regular attachments (#10998) 2025-02-28 13:33:48 -08:00
mailers feat: add Google Email fetch and OAuth token refresh service (#9603) 2024-06-11 14:22:03 +05:30
models fix: Fix duplicate contact inbox race condition (#11139) 2025-03-20 18:24:28 -07:00
policies fix: Added authentication to FireCrawl API, remove unused RobinAI references (#10737) 2025-01-22 18:14:25 -08:00
presenters chore: Update the precision of the updated_at timestamp in conversation model (#10875) 2025-02-10 20:22:11 -08:00
services chore: remove logging from search service (#11112) 2025-03-19 19:10:25 +05:30
views feat: Support card message postback event as widget event (#11133) 2025-03-20 12:00:24 -07:00
workers fix: Capture delivery errors to avoid false positives (#8790) 2024-01-26 14:22:18 +04:00