Skip to content

Update sender rules of the affected groups only - #693

Open
pierretux wants to merge 1 commit into
Probesys:mainfrom
pierretux:fix/691-update-sender-rules-per-group
Open

pierretux wants to merge 1 commit into
Probesys:mainfrom
pierretux:fix/691-update-sender-rules-per-group

Conversation

@pierretux

@pierretux pierretux commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Related issue(s)

Closes #691

GroupService::updateSenderRules() now accepts the list of groups to update, and only the wblist rows of these groups are deleted and regenerated. Without argument, all the groups are still updated (kept for the LDAP import, the aliases CSV import and the agentj:update-group-rules command, which are bulk operations).

  • group edit, group rule create/edit/delete, user removed from a group: the group only
  • user/alias creation: the user's groups
  • user edit: the old and new groups of the user, so the rules of a group the user was removed from are deleted
  • users CSV import: the groups touched by the import (the existing, unused $groupWbUpdate array)
  • group deletion: the call is removed, wblist.group_id is ON DELETE CASCADE

How to test manually

  1. Create two active groups A and B on a domain, with a user member of both.
  2. Add a rule to each group, check the rows in wblist (SELECT * FROM wblist WHERE group_id IS NOT NULL).
  3. Edit the rule of group A: only the rows of group A are regenerated (datemod of group B rows is unchanged), and the new value is applied.
  4. Edit the user and remove it from group B: the user's rows for group B are deleted.
  5. Delete group A: its rows are deleted from wblist.

Reviewer checklist

  • Code is manually tested
  • Interface works on both mobiles and big screens
  • Interface works on both Firefox and Chrome
  • Tests are up to date
  • Documentation is up to date
  • Pull request has been reviewed and approved

GroupService::updateSenderRules() deleted and regenerated the sender
rules of all the groups each time a group, a group rule or a user was
modified. It now accepts the list of the groups to update. Without
argument, it still updates all the groups (used by the LDAP import, the
alias import and the agentj:update-group-rules command).

When editing a user, both the old and the new groups are updated so the
rules of the groups the user has been removed from are deleted. When
deleting a group, nothing needs to be done as the rules are deleted by
the database (ON DELETE CASCADE).

Closes Probesys#691
@pierretux
pierretux force-pushed the fix/691-update-sender-rules-per-group branch from 12828c8 to f4c9af7 Compare November 6, 2026 11:16
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.

Improve updating group sender rules

1 participant