Logging hole for Group Histories

AI-generated summary

The discussion addresses a logging gap in Discourse’s Group Histories, where actions taken during group creation were not recorded in the group’s activity log. MentalNomad reported that when a member was designated as the Owner during the initial group setup, no group_histories entry was generated for their addition. This made it impossible to track when the member was added via the group’s Logs tab, creating confusion for staff monitoring permissions. The user suggested that setting the Owner should trigger a separate log entry to ensure accurate forensics.

martin acknowledged the issue and accepted the task. After a delay due to other priorities, martin submitted a pull request (#37054) to fix the logging behavior. The fix was subsequently merged into the codebase (6).

Additionally, fzngagan noted that Discourse has since implemented Staff Actions logging for group creation. Administrators can now view the creator and creation timestamp of a group on the Logs and Screening page in the admin dashboard, providing another layer of visibility for group lifecycle events.

I recently needed to check on when a particular member was added to a group with Category Moderator permissions.

Using the logs tab on the group in the GUI, I was easily able to see when the member was removed, but not when they were added; it looked as if they were never added.

Some playing around in the Data Explorer add-on confirmed there was no log entry of their addition.

What we’ve surmised is that on the Discourse page for creating a New Group, the user was set as the Owner at the time the Group was specified, so when the Group was created, they were “already” a member and there was no log entry made for their addition. (From the time the group was created until the addition of another member a year later, there were no additions to the group, which should otherwise be impossible.)

Bug Fix? / Feature Suggestion:

For accurate logging and forensics, I’d suggest that setting the Owner of a group be given a separate entry row in group_histories immediately after the group is created. This will ensure it shows up on the Logs tab of the group Manage page, which is otherwise confusing.

(It would also be nice if the group manage Logs tab showed the group creation date, but that might be more complex.)

Side note: I suspect the same is true of members added on the New Group page, but I have not confirmed that.

3 Likes

Sounds like a good idea, I will take this.

5 Likes

Sorry this has been taking a while, other priorities came up. I’ve got a PR out for review now, shouldn’t be too much longer:

https://github.com/discourse/discourse/pull/37054

4 Likes

Alright, this has been merged now :rocket:

2 Likes

We’ve since added Staff Actions logging for when a new group is created. You can take a look on the Logs and Screening page in the admin dashboard to see who created the group and the creation timestamp as well.