mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-08 11:19:36 +03:00
Inconsistent created_by and updated_by structure in related_item for commented_on vs. comment_delete webhooks #5572
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @csongs on GitHub (Jan 22, 2026).
Describe the Bug
When using webhooks for comment-related events, the structure of the created_by and updated_by fields within the related_item object is inconsistent between the commented_on and comment_delete events.
For the commented_on event, related_item.created_by and related_item.updated_by are provided as full user objects (containing id, name, slug). However, for the comment_delete event, these same fields (related_item.created_by and related_item.updated_by) are provided as simple integer user IDs.
This inconsistency makes it challenging to uniformly process webhook payloads for comment-related activities, as the data structure for user information changes depending on the event type. Developers need to implement conditional logic to parse these fields, which adds unnecessary complexity.
Steps to Reproduce
Detail the steps that would replicate this issue.
Configure a Webhook:
https://your-bookstack-instance.com/settings/webhooks).commented_onandcomment_delete.Create a Page and Add a Comment:
Observe
commented_onWebhook Payload:commented_onevent.related_itemobject within the JSON payload.created_byandupdated_byfields within thisrelated_itemobject (they should appear as full user objects withid,name,slug).Delete the Comment:
Observe
comment_deleteWebhook Payload:comment_deleteevent.related_itemobject within the JSON payload.created_byandupdated_byfields within thisrelated_itemobject (they should appear as simple integer user IDs).Compare Structures:
created_byandupdated_byfields from thecommented_onpayload (Step 3) with those from thecomment_deletepayload (Step 5). You will observe the inconsistency in their data types/structures.Expected Behaviour
I expect the created_by and updated_by fields within the related_item object to have a consistent structure across all comment-related webhook events (commented_on, comment_delete, comment_update).
Screenshots or Additional Context
No response
Browser Details
No response
Exact BookStack Version
v25.12.1