Skip to content

feat: preserve pre-existing group members in mutable mode#40

Open
jfroche wants to merge 1 commit intonikstur:mainfrom
jfroche:fix-existing-groups-members
Open

feat: preserve pre-existing group members in mutable mode#40
jfroche wants to merge 1 commit intonikstur:mainfrom
jfroche:fix-existing-groups-members

Conversation

@jfroche
Copy link

@jfroche jfroche commented Feb 4, 2026

Previously, users added to groups before userborn activation were removed when userborn ran.

In mutable users mode, group membership updates now preserve pre-existing members while still allowing configured members to be added or removed.

On deactivation, only the configured members are removed, preserving any pre-existing members that were added before userborn activation.

In immutable mode, the previous behavior of replacing group members entirely on activation is retained.

Users added to groups before userborn activation are currently removed
on activation. This commit changes the behavior in mutable users mode to
preserve pre-existing group members.

Group membership updates are now the union of existing and configured
members instead of replacing.

On deactivation, only the configured members are removed, preserving
any pre-existing members that were added before userborn activation.

In immutable mode, the previous behavior of replacing group members
entirely on activation is retained.
@jfroche
Copy link
Author

jfroche commented Feb 5, 2026

Note that we don't preserve the original order of the list of users in the group as we are using BTreeSet for the moment. We could have it using IndexSet from https://crates.io/crates/indexmap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant