Skip to content

Reconcile only the affected card after a contact mutation#39

Merged
Sancus merged 2 commits into
mainfrom
whitelist-perf
Jun 16, 2026
Merged

Reconcile only the affected card after a contact mutation#39
Sancus merged 2 commits into
mainfrom
whitelist-perf

Conversation

@Sancus

@Sancus Sancus commented Jun 16, 2026

Copy link
Copy Markdown
Member

No description provided.

Sancus added 2 commits June 16, 2026 07:01
…ole book.

Whitelisting a sender (and contact add/edit) re-pulled and re-persisted the
entire address book via a full syncContacts on every write, so the
click-to-toast latency scaled with contact count (measured ~41ms of outbox
work at 1 contact vs ~150ms at 1000 in a warm container, and far worse on a
real IndexedDB-backed cache). Replace the full reconcile with a targeted
fetch+upsert of only the new/edited card(s) via reconcileContactCards, so the
cache-matches-server guarantee stays at O(books)+O(ids) instead of
O(contacts). Adds a 1000-contact test asserting a whitelist fetches only the
single new card and never re-pulls the address book.
Exercise a 200-message multi-select "Not junk" from 150 distinct senders
against a 1099-contact address book, asserting the 150 unique senders are
trusted in a single batched ContactCard/set, only the 150 new cards are
fetched (never the 1099 existing), and no full address-book re-pull occurs.
@Sancus Sancus merged commit c5c176a into main Jun 16, 2026
9 checks passed
@Sancus Sancus deleted the whitelist-perf branch June 16, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant