Skip to content

Store user groups #662

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

Open
gnprice opened this issue May 13, 2024 · 2 comments
Open

Store user groups #662

gnprice opened this issue May 13, 2024 · 2 comments
Labels
a-api Implementing specific parts of the Zulip server API a-model Implementing our data model (PerAccountStore, etc.)

Comments

@gnprice
Copy link
Member

gnprice commented May 13, 2024

We should store the list of user groups in the realm, with their metadata and their memberships, and keep the data up to date.

This data originates as realm_user_groups in the initial snapshot at https://zulip.com/api/register-queue#response , and is updated by events.

As a preparatory refactor, we'll move PerAccountStore.users (which is a Map<int, User>, indexed by user ID) to live on a new type UserStore. This will closely follow the example of streams and StreamStore.

Then the user groups will be added as an additional data structure on UserStore.

This is a prerequisite for features involving user groups, in particular:

@gnprice gnprice added a-api Implementing specific parts of the Zulip server API a-model Implementing our data model (PerAccountStore, etc.) labels May 13, 2024
@gnprice gnprice added this to the Beta 3: Summer 2024 milestone May 13, 2024
@gnprice gnprice modified the milestones: Beta 3: Summer 2024, Launch Jul 26, 2024
@gnprice
Copy link
Member Author

gnprice commented Sep 11, 2024

We're likely about to add a client capability on the server related to user groups, with a name like allow_deactivated:
https://chat.zulip.org/#narrow/stream/378-api-design/topic/deactivated.20groups.20in.20.60GET.60.20endpoints/near/1940349

So when implementing this part of the API, we should start sending that client capability.

(In general, we should always be sending all client capabilities that have been defined so far. That way we get the latest version of the API, rather than an API that's been adapted for older clients.)

@gnprice
Copy link
Member Author

gnprice commented Oct 10, 2024

For current servers since zulip/zulip#29498 (server-10, ZFL 303), correctly maintaining user groups will also involve acting on RealmUserUpdateEvent.isActive. See the API docs for that property.

Chat thread: https://chat.zulip.org/#narrow/stream/378-api-design/topic/Groups.20events.20for.20deactivated.20users/near/1958907

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: No status
Development

No branches or pull requests

1 participant