-
Notifications
You must be signed in to change notification settings - Fork 307
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
Comments
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. |
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. |
TODO widget tests Fixes: zulip#1499
TODO widget tests Fixes: zulip#1499
TODO widget tests Fixes: zulip#1499
TODO widget tests Fixes: zulip#1499
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
andUnreads
, 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:
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
.The text was updated successfully, but these errors were encountered: