Bug Fix

Fix duplicate contact creation from simultaneous inbound texts

When two webhook events for the same unknown inbound phone number
landed within milliseconds of each other — a common pattern for iMessage
delivery and provider retries — the CRM could create two or three
contact records for the same person. The first record received the
message and activity timeline; the extras were empty duplicates that
still had default lead-flow rules applied.

What’s Fixed

  • Contact lookups for inbound texts and calls now serialize through a
    per-team, per-phone-number lock, so only one record is created when
    concurrent webhooks arrive for the same unknown sender.
  • Applies to SendBlue iMessage, Twilio SMS, Twilio Conversations, and
    Twilio voice flows.
  • Distinct from the April 21 ghost-contact fix (blank phone numbers);
    this one addresses the race condition on valid numbers.

Existing duplicates must still be merged manually, but no new duplicates
should appear going forward.