mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-16 05:00:45 +08:00
3b9ba55bbf
Summary: The old approach we were using to track unread counts by category was really complicated because it involved computing changes to counts in javascript and then syncing them back to the database, from each process that was making queries. Rather than try to fix that, this diff moves us to a new approach where the counts are maintained by executing a query before and after threads are modified to unapply / reapply them from the counters. Doing this in the database in the same transactions as the thread modifications themselves ensures the counts are internally consistent with the Threads table. This SQL approach is also able to compute initial counts way faster - initializing totals and unreads in a 1GB edgehill.db in about 1 second on my machine. Test Plan: All old tests removed, new tests coming Reviewers: evan, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D2757 |
||
---|---|---|
.. | ||
account-store-spec.coffee | ||
category-store-spec.es6 | ||
contact-store-spec.coffee | ||
database-setup-query-builder-spec.coffee | ||
database-store-spec.coffee | ||
database-transaction-spec.coffee | ||
draft-store-proxy-spec.coffee | ||
draft-store-spec.coffee | ||
file-download-store-spec.coffee | ||
file-upload-store-spec.coffee | ||
focused-contacts-store-spec.coffee | ||
focused-content-store-spec.coffee | ||
focused-perspective-store-spec.coffee | ||
message-store-spec.coffee | ||
nylas-sync-status-store-spec.es6 | ||
task-queue-spec.coffee | ||
unread-badge-store-spec.coffee |