Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain total unread counts efficiently #370

Open
gnprice opened this issue Nov 7, 2023 · 0 comments
Open

Maintain total unread counts efficiently #370

gnprice opened this issue Nov 7, 2023 · 0 comments
Labels
a-model Implementing our data model (PerAccountStore, etc.) performance Smooth and responsive UI; fixing jank, stutters, and lag

Comments

@gnprice
Copy link
Member

gnprice commented Nov 7, 2023

For counting the number of unread messages you have in a stream, or overall, our initial implementation (in #364) will iterate each time through all your unread topics in that stream, or all your unread topics and DM conversations, in order to add up the numbers of unreads.

This is inefficient. In a busy realm, it's common to have thousands of unread conversations, and that could be enough to make this material. So we should do something efficient instead: maintain a count for each stream, and an overall count, and update those incrementally on events.

This will come after we implement stream and topic muting (#346), because that feature will add complexity to these counts — the counts we want are the ones that take account of muting, not the raw totals — and may affect the shape of how we want to build this.

A version of this was drafted as #345 but not merged. It was focused on the raw totals, but parts of it may be useful when we go to implement this after we have muting.

@gnprice gnprice added the a-model Implementing our data model (PerAccountStore, etc.) label Nov 7, 2023
@gnprice gnprice added this to the Launch milestone Nov 7, 2023
@gnprice gnprice mentioned this issue Nov 7, 2023
@gnprice gnprice added the performance Smooth and responsive UI; fixing jank, stutters, and lag label Nov 18, 2023
@gnprice gnprice modified the milestones: Launch, Post-launch Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-model Implementing our data model (PerAccountStore, etc.) performance Smooth and responsive UI; fixing jank, stutters, and lag
Projects
Status: No status
Development

No branches or pull requests

1 participant