-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Improve handling of deleted user groups #11584
Comments
Hello @zulip/server-message-view, @zulip/server-settings members, this issue was labeled with the "area: message view", "area: settings (admin/org)" labels, so you may want to check it out! |
@zulipbot claim |
@timabbott When User group is deleted ,the delete event is sent as |
It would break the mobile or terminal clients. In any case, I think |
@timabbott should the deactivated user group mention be highlighted for which current user is member? |
Hmm, good question. I think it's not super important to do that (or anything else that requires sending data on the user group to the frontend). |
"This user group has been deleted" in popover for deactivated user group when users click it, rather than just doing nothing. Fixes: zulip#11584.
"This user group has been deleted" in popover for deactivated user group when users click it, rather than just doing nothing. Fixes: zulip#11584.
"This user group has been deleted" in popover for deactivated user group when users click it, rather than just doing nothing. Fixes: zulip#11584.
Hello @thedeveloperr, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days. You can reclaim this issue or claim any other issue by commenting Thanks for your contributions, and hope to see you again soon! |
Waiting for review On previous PR |
@zulipbot waiting for review |
@zulipbot claim |
"This user group has been deleted" in popover for deactivated user group when users click it, rather than just doing nothing. Fixes: zulip#11584.
"This user group has been deleted" in popover for deactivated user group when users click it, rather than just doing nothing. Fixes: zulip#11584.
This user group has been deleted" in popover for deactivated user group when users click it, rather than just doing nothing. Fixes: zulip#11584.
This user group has been deleted" in popover for deactivated user group when users click it, rather than just doing nothing. Fixes: zulip#11584.
Hello @thedeveloperr, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days. You can reclaim this issue or claim any other issue by commenting Thanks for your contributions, and hope to see you again soon! |
Use this function for group mention in markdown.js. TODO: Implement similar function for resolving group mention in backend. As a part of zulip#11584
Earlier we were using get_user_group_name_info for resolving user group mention in backend. But as there can be many user groups with same name, changed it to query only the unique active user group. Fixes zulip#11584
Display a user group has been deleted popover when one clicks on deactivated user group mention. TODO: Currently if we mention a user group and delete it and then create a new user group with same name. In the mention of new user_group we still get user group has been deleted popover. This is because in markdown we find user group from name instead of active user group from name and thus it requires to be changed to use get_active_user_group_from_name. As a part of zulip#11584
Use this function for group mention in markdown.js. TODO: Implement similar function for resolving group mention in backend. As a part of zulip#11584
Earlier we were using get_user_group_name_info for resolving user group mention in backend. But as there can be many user groups with same name, changed it to query only the unique active user group. Fixes zulip#11584
Add active field which is used to tell whether the group is active or not and change the constraint to have unique active user_group per realm while having any number of similar ones which are inactive. This is done for deactivating the user_groups instead of entirely deleting them from the database. TODO: Add backend and frontend support for the new handling of deleting user groups using active field. As a part of zulip#11584
This changes the way we delete user_groups in backend. Instead of deleting, deactivate them. Send the active and inactive groups to frontend. Also document the feature level and do provision version bump. We don't send active field for add user_group event as it is true by default for a newly created user group. Only send it for the get/fetch event. So, created new Schemas UserGroupAdd and UserGroupGet to distinguish the fields which are sent in both. A thing worth mentioning is as we don't send is_active field for add event in lib/events, have explicitely added it as we need to segregate active and inactive usergroups while sending it to frontend. TODO: Add frontend support for this feature. As a part of zulip#11584
Added a active_user_group_by_id_dict to map the active user groups to their id. Also the following functions are added. 1. add_in_realm To add a new user group to active_user_group_by_id_dict and user_group_by_id_dict. For more context add only adds user_group to user_group_by_id_dict. 2. get_active_user_group_from_id To get the active user group from id. Return undefined if group is not found. 3. is_active_user_group To find if a user_group is active. 4. get_active_user_group_from_name To get active user group from name. TODO: Modify remove function to instead delete group from active_user_group_by_id_dict. Also initialize this dict from the active and non active groups sent in page_params. As a part of zulip#11584
Following functions are modified to deactivate user groups instead of deleting. 1. remove Instead of deleting from all user groups only delete it from active user groups. 2. get_realm_user_groups Return only the active user groups. 3. initialize Add all the active user groups to user_groups_by _id_dict and active_user_groups_by_id_dict and the inactive ones only to user_groups_by_id_dict. TODO: Currently the user_group add event of server_events_dispatch calls add function. This needs to be changed to the new add_in_realm function. Also a popover showing user group has been deleted needs to be displayed in the mention of deleted user_group. As a part of zulip#11584
TODO: Display a user group has been deleted popover on clicking deleted group mention. As a part of zulip#11584
Display a user group has been deleted popover when one clicks on deactivated user group mention. TODO: Currently if we mention a user group and delete it and then create a new user group with same name. In the mention of new user_group we still get user group has been deleted popover. This is because in markdown we find user group from name instead of active user group from name and thus it requires to be changed to use get_active_user_group_from_name. As a part of zulip#11584
Use this function for group mention in markdown.js. TODO: Implement similar function for resolving group mention in backend. As a part of zulip#11584
Earlier we were using get_user_group_name_info for resolving user group mention in backend. But as there can be many user groups with same name, changed it to query only the unique active user group. Fixes zulip#11584
Add active field which is used to tell whether the group is active or not and change the constraint to have unique active user_group per realm while having any number of similar ones which are inactive. This is done for deactivating the user_groups instead of entirely deleting them from the database. TODO: Add backend and frontend support for the new handling of deleting user groups using active field. As a part of zulip#11584
This changes the way we delete user_groups in backend. Instead of deleting, deactivate them. Send the active and inactive groups to frontend. Also document the feature level and do provision version bump. We don't send active field for add user_group event as it is true by default for a newly created user group. Only send it for the get/fetch event. So, created new Schemas UserGroupAdd and UserGroupGet to distinguish the fields which are sent in both. A thing worth mentioning is as we don't send is_active field for add event in lib/events, have explicitely added it as we need to segregate active and inactive usergroups while sending it to frontend. TODO: Add frontend support for this feature. As a part of zulip#11584
Added a active_user_group_by_id_dict to map the active user groups to their id. Also the following functions are added. 1. add_in_realm To add a new user group to active_user_group_by_id_dict and user_group_by_id_dict. For more context add only adds user_group to user_group_by_id_dict. 2. get_active_user_group_from_id To get the active user group from id. Return undefined if group is not found. 3. is_active_user_group To find if a user_group is active. 4. get_active_user_group_from_name To get active user group from name. TODO: Modify remove function to instead delete group from active_user_group_by_id_dict. Also initialize this dict from the active and non active groups sent in page_params. As a part of zulip#11584
Following functions are modified to deactivate user groups instead of deleting. 1. remove Instead of deleting from all user groups only delete it from active user groups. 2. get_realm_user_groups Return only the active user groups. 3. initialize Add all the active user groups to user_groups_by _id_dict and active_user_groups_by_id_dict and the inactive ones only to user_groups_by_id_dict. TODO: Currently the user_group add event of server_events_dispatch calls add function. This needs to be changed to the new add_in_realm function. Also a popover showing user group has been deleted needs to be displayed in the mention of deleted user_group. As a part of zulip#11584
TODO: Display a user group has been deleted popover on clicking deleted group mention. As a part of zulip#11584
Display a user group has been deleted popover when one clicks on deactivated user group mention. TODO: Currently if we mention a user group and delete it and then create a new user group with same name. In the mention of new user_group we still get user group has been deleted popover. This is because in markdown we find user group from name instead of active user group from name and thus it requires to be changed to use get_active_user_group_from_name. As a part of zulip#11584
Use this function for group mention in markdown.js. TODO: Implement similar function for resolving group mention in backend. As a part of zulip#11584
Earlier we were using get_user_group_name_info for resolving user group mention in backend. But as there can be many user groups with same name, changed it to query only the unique active user group. Fixes zulip#11584
The current model for user groups doesn't match how we handle deleting other objects, namely that when you "delete" it in the UI, we actually delete it from the database.
This results in our needing to do error handling hacks like 4e53110, which are bad because they can't distinguish actual bugs in the software from a deleted user group. There are two reasonable parts of a solution:
The text was updated successfully, but these errors were encountered: