Reconcile only the affected card after a contact mutation#39
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.