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

local echo (2/n): Rearrange queueId and sendMessage within store #1455

Merged
merged 3 commits into from
Apr 3, 2025

Conversation

PIG208
Copy link
Member

@PIG208 PIG208 commented Apr 1, 2025

@PIG208 PIG208 changed the title Rearrange queueId and sendMessage within store (2/n) locale echo (2/n): Rearrange queueId and sendMessage within store Apr 1, 2025
@PIG208 PIG208 added the maintainer review PR ready for review by Zulip maintainers label Apr 1, 2025
@PIG208 PIG208 requested a review from rajveermalviya April 1, 2025 22:17
Copy link
Member

@rajveermalviya rajveermalviya left a 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.

@rajveermalviya rajveermalviya added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Apr 2, 2025
@rajveermalviya rajveermalviya requested a review from gnprice April 2, 2025 13:23
@PIG208 PIG208 changed the title locale echo (2/n): Rearrange queueId and sendMessage within store local echo (2/n): Rearrange queueId and sendMessage within store Apr 2, 2025
Copy link
Member

@gnprice gnprice left a 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.

@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
String queueId;
final String queueId;

Right? (Just like it was when on UpdateMachine.)

Comment on lines 1078 to 1076
final String queueId;
String get queueId => store.queueId;
Copy link
Member

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.

Copy link
Member Author

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.

Comment on lines 218 to 219
connection.prepare(json:
deepToJson(eg.initialSnapshot()) as Map<String, dynamic>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation

@PIG208
Copy link
Member Author

PIG208 commented Apr 2, 2025

Thanks! I have updated the PR.

PIG208 added 3 commits April 2, 2025 23:14
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.
@gnprice
Copy link
Member

gnprice commented Apr 3, 2025

Thanks for the revision! Looks good; merging.

@gnprice gnprice merged commit c5d0abf into zulip:main Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration review Added by maintainers when PR may be ready for integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants