Skip to content

Keep track of topics in ChannelStore #1499

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

Open
PIG208 opened this issue May 6, 2025 · 2 comments · May be fixed by #1508
Open

Keep track of topics in ChannelStore #1499

PIG208 opened this issue May 6, 2025 · 2 comments · May be fixed by #1508
Labels
a-model Implementing our data model (PerAccountStore, etc.)

Comments

@PIG208
Copy link
Member

PIG208 commented May 6, 2025

This is follow-up to #1158.

The initial implementation of the topic-list will fetch topics with API calls. Using the data we have, by listening to changes to PerAccountStore and Unreads, we only know about the topic visibility and unreads changes. But not all of its data is up-to-date.

We need to make sure that the data store is specialized for managing what we know about topics, by channels. Some examples of events that need to be handled:

  • message events, for new topics;
  • update-message events, for moved or (un)resolved topics.

Since the topic-list page orders the topic by the last message sent, the data structure should keep track of the message IDs in each topic.

Ideally, as a follow-up to this, the data store will also keep track of whether previous requests to fetch topics have failed, but that's of lower priority than handling a similar issue with fetch requests errors from MessageListView.fetchInitial.

@PIG208 PIG208 added this to the M5b: Launch goals milestone May 6, 2025
@PIG208 PIG208 added the a-model Implementing our data model (PerAccountStore, etc.) label May 6, 2025
@gnprice
Copy link
Member

gnprice commented May 7, 2025

Specifically I'd think of the data structure here as basically recording the results of past calls to https://zulip.com/api/get-stream-topics (the same endpoint that the initial implementation of #1158 will also use) — but then keeping those results up to date with events.

@gnprice
Copy link
Member

gnprice commented May 7, 2025

The main user-facing impact of this, compared to the version in #1500 where those /api/get-stream-topics results are just kept on the state of the _TopicList widget, is:

With the simpler initial version, if the user keeps a topic-list page open while they go and make changes, its list of topics won't get updated. It'll get updated only when they navigate out from the page and then navigate to it afresh, causing a new state to be created and make a new request.

This applies to the names of the topics and their ordering, i.e. the information that comes from /api/get-stream-topics . It doesn't apply to the unread counts, or the muted/followed/etc. states, because those are already part of PerAccountStore and kept up to date with events.

PIG208 added a commit to PIG208/zulip-flutter that referenced this issue May 9, 2025
PIG208 added a commit to PIG208/zulip-flutter that referenced this issue May 9, 2025
@PIG208 PIG208 linked a pull request May 9, 2025 that will close this issue
PIG208 added a commit to PIG208/zulip-flutter that referenced this issue May 9, 2025
PIG208 added a commit to PIG208/zulip-flutter that referenced this issue May 10, 2025
PIG208 added a commit to PIG208/zulip-flutter that referenced this issue May 10, 2025
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.)
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants