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

Handle created/deleted streams (stream op: create and stream op: delete events) #181

Closed
chrisbobbe opened this issue Jun 14, 2023 · 2 comments · Fixed by #183
Closed

Handle created/deleted streams (stream op: create and stream op: delete events) #181

chrisbobbe opened this issue Jun 14, 2023 · 2 comments · Fixed by #183
Assignees
Labels
a-api Implementing specific parts of the Zulip server API a-model Implementing our data model (PerAccountStore, etc.)
Milestone

Comments

@chrisbobbe
Copy link
Collaborator

chrisbobbe commented Jun 14, 2023

Part of #135.

https://zulip.com/api/get-events#stream-create
https://zulip.com/api/get-events#stream-delete

Handling changed streams (stream op: update) is #182; there are some potentially tricky details to get right there.

I expect this will involve updating both our store.streams and store.subscriptions data structures.

@chrisbobbe chrisbobbe added the a-api Implementing specific parts of the Zulip server API label Jun 14, 2023
@chrisbobbe chrisbobbe added the a-model Implementing our data model (PerAccountStore, etc.) label Jun 14, 2023
@chrisbobbe
Copy link
Collaborator Author

chrisbobbe commented Jun 14, 2023

I expect this to be pretty straightforward.

As a bonus, it will support adding helpers like createStream and deleteStream on PerAccountStoreTestExtension in test/model/test_store.dart, following the pattern of addUser there. Those helpers will support writing tests for logic that depends on the contents of store.streams, including quote-and-reply #116. (The "said" link is a message link, which might include a segment like /stream/243-mobile-team, for which we'll consult store.streams[streamId].name.)

Adding to the "Alpha" milestone to match #116.

@chrisbobbe
Copy link
Collaborator Author

I expect this will involve updating both our store.streams and store.subscriptions data structures.

I guess on "create", we don't want to add anything to store.subscriptions. The event doesn't carry details of the user's subscription to the stream, if they're even subscribed at all. If the user is subscribed, I assume the stream-create event will be followed by a subscription event.

On "delete", probably we do want to remove entries from store.subscriptions, like we do in zulip-mobile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-api Implementing specific parts of the Zulip server API a-model Implementing our data model (PerAccountStore, etc.)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant