-
Notifications
You must be signed in to change notification settings - Fork 306
channel: Maintain maps consistently when removing subscriptions #1479
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM! Marking for Greg's review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! Just a couple of nits below.
test/model/channel_test.dart
Outdated
@@ -68,6 +68,22 @@ void main() { | |||
)); | |||
checkUnified(store); | |||
}); | |||
|
|||
test('removed then added by events', () async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test('removed then added by events', () async { | |
test('unsubscribed then subscribed by events', () async { |
The group is about "stream/sub data" in general, so this otherwise sounds like it's probably about removing the whole stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separately, since this is a regression test for a particular bug that we actually had, let's link that context:
test('removed then added by events', () async { | |
test('removed then added by events', () async { | |
// Regression test for: https://chat.zulip.org/#narrow/channel/48-mobile/topic/Unsubscribe.20then.20resubscribe.20to.20channel/with/2160241 |
Thanks! Updated the PR. |
When a subscription is removed, the data in streams and streamsByName are left as instances of `Subscription`. This is inconsistent with the data store's assumption that unsubscribed channels should have plain `ZulipStream` instances. This doesn't seem to have user-facing effects, though. The assertion errors only affect debug builds. CZO discussion: https://chat.zulip.org/#narrow/channel/48-mobile/topic/Unsubscribe.20then.20resubscribe.20to.20channel/with/2160241
Thanks! Looks good; merging. |
When a subscription is removed, the data in streams and streamsByName are left as instances of
Subscription
. This is inconsistent with the data store's assumption that unsubscribed channels should have plainZulipStream
instances.This doesn't seem to have user-facing effects, though. The assertion errors only affect debug builds.
CZO discussion:
https://chat.zulip.org/#narrow/channel/48-mobile/topic/Unsubscribe.20then.20resubscribe.20to.20channel/with/2160241