Skip to content

Keep topic-list page updated, by tracking topics in ChannelStore #1499

Open
@PIG208

Description

@PIG208
Member

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.

Activity

added this to the M5b: Launch goals milestone on May 6, 2025
added
a-modelImplementing our data model (PerAccountStore, etc.)
on May 6, 2025
gnprice

gnprice commented on May 7, 2025

@gnprice
Member

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

gnprice commented on May 7, 2025

@gnprice
Member

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.

added 2 commits that reference this issue on May 9, 2025
6b7ff1d
534478a
linked a pull request that will close this issue on May 9, 2025
added 5 commits that reference this issue on May 9, 2025
e2b2d1d
0f3372c
306a9ab
0c937dc
6632f36
changed the title [-]Keep track of topics in ChannelStore[/-] [+]Keep topic-list page updated, by tracking topics in ChannelStore[/+] on Jun 12, 2025

4 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-modelImplementing our data model (PerAccountStore, etc.)beta feedbackThings beta users have specifically asked forlaunch feedbackThings users specifically asked for upon launch

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

      Development

      Participants

      @gnprice@PIG208

      Issue actions

        Keep topic-list page updated, by tracking topics in ChannelStore · Issue #1499 · zulip/zulip-flutter