Pin the contact-point and linker invariants, and drop timeline count queries

Testkamo-shared-library
Shipped
August 5, 2026 at 6:40 PM UTC
Author
Kamo
Commit
f3b591a

The two classes the whole feature rests on had no tests, and all three properties they guarantee fail silently in production: an unmatched call is indistinguishable from a call from a stranger, and a duplicated one just looks like the lead really did call twice. LeadContactPointServiceTest covers the window diff — an unchanged re-save must not fragment history, a reformatted number is not a change, and a replaced number closes and reopens at the same instant so a call on the boundary matches exactly one window. It also asserts the close is flushed before the open, which is what keeps the partial unique index satisfied. LeadCommunicationLinkerTest covers point-in-time matching: a number added in June must not claim a call from January, a superseded number must not claim calls after it was replaced, and a record the sweep discovers late still binds to the window that covered it. Plus formatting-insensitivity, idempotent re-ingest, blanks-only enrichment, and shared household numbers. Both use throwing repository stubs, so a newly-introduced repository call surfaces as a failure rather than silently exercising a different path. Also: the two keyset queries return List instead of Page — Spring Data runs a and MediaObjSocialRef gains a batch lookup so chat direction resolves in one query per page rather than one per message.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing