-
Notifications
You must be signed in to change notification settings - Fork 306
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
local echo (2/n): Rearrange queueId
and sendMessage
within store
#1455
Conversation
queueId
and sendMessage
within store (2/n)queueId
and sendMessage
within store
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! This looks good to me. Marking for Greg's review.
queueId
and sendMessage
within storequeueId
and sendMessage
within store
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! Looks good, with small comments below.
lib/model/store.dart
Outdated
@@ -420,6 +429,7 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel | |||
final GlobalStore _globalStore; | |||
final ApiConnection connection; // TODO(#135): update zulipFeatureLevel with events | |||
|
|||
String queueId; |
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.
String queueId; | |
final String queueId; |
Right? (Just like it was when on UpdateMachine.)
lib/model/store.dart
Outdated
final String queueId; | ||
String get queueId => store.queueId; |
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.
This getter is fine for keeping the commit small, but let's have a followup commit clean it up by having its callers refer directly to the store. I think most of them won't even get any longer — they'll replace something like updateMachine.queueId
with store.queueId
.
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.
The change needed removing this ends up being quite small, so I added it to the same commit.
test/model/store_test.dart
Outdated
connection.prepare(json: | ||
deepToJson(eg.initialSnapshot()) as Map<String, dynamic> |
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.
nit: indentation
Thanks! I have updated the PR. |
MessageStore stands out as a better home for sendMessage, which was on PerAccountStore before we extracted all the separate stores. This will make it more natural to support outbox/local echoing.
This is an NFC because UpdateMachine would have thrown (before this change) when the null-check is not on PerAccountStore. This queueId will later be used for local-echoing.
Thanks for the revision! Looks good; merging. |
Related: