vikunja/pkg
kolaente 0cd25f47e5
fix: populate complete entity data in deletion event webhooks (#2135)
Fixes webhook payloads for deletion events that were previously
containing incomplete or empty entity data. This occurred because
entities were being deleted from the database before the webhook event
was dispatched.

## Changes

This PR implements four targeted fixes to ensure complete entity data in
deletion event webhooks:

### 1. TaskAssignee Deletion (`pkg/models/listeners.go`)
- Extended `reloadEventData()` to fetch full assignee user data by ID
- Webhook payload now includes complete user object (username, email,
timestamps, etc.)

### 2. TaskComment Deletion (`pkg/models/task_comments.go`)
- Modified `Delete()` to call `ReadOne()` before deletion
- Ensures comment text, author, and timestamps are included in webhook
payload
- Follows the same pattern used by `Task.Delete()` and
`TaskAttachment.Delete()`

### 3. TaskAttachment Deletion (`pkg/models/task_attachment.go`)
- Extended `ReadOne()` to fetch the `CreatedBy` user
- Webhook payload now includes file creator information

### 4. TaskRelation Deletion (`pkg/models/task_relation.go`)
- Modified `Delete()` to fetch complete relation including `CreatedBy`
user before deletion
- Webhook payload now includes relation timestamps and creator
information

Fixes #2125
2026-01-24 12:50:18 +01:00
..
caldav fix(caldav): do not assume the first element is the VTODO component 2025-12-13 15:30:22 +01:00
cmd fix(positions): detect and repair duplicate task positions automatically (#1998) 2025-12-20 19:38:28 +01:00
config feat: add configurable gravatar-compatible base URL (#2083) 2026-01-13 14:58:08 +01:00
cron fix: correct license header references (#882) 2025-06-10 12:18:38 +02:00
db fix(kanban): repeating tasks dates won't update when moved in done bucket (#1638) 2025-11-14 16:57:53 +00:00
events fix(events): only trigger task.updated once when marking task done 2025-11-16 11:01:15 +01:00
files fix(deps): update module github.com/fclairamb/afero-s3 to v0.4.0 (#2087) 2026-01-15 16:21:16 +01:00
health feat: introduce shared health check logic (#1073) 2025-07-02 21:01:41 +00:00
i18n chore(i18n): update translations via Crowdin 2025-12-12 00:59:39 +00:00
initialize feat: add S3 file storage support (#1688) 2025-11-06 08:37:04 +01:00
log fix: set log path before creating log handler (#2064) 2026-01-08 13:53:08 +00:00
mail fix(mail): disable queue when mailer disabled (#2069) 2026-01-08 15:51:31 +01:00
metrics fix: correct license header references (#882) 2025-06-10 12:18:38 +02:00
migration fix: handle mixed-format bucket configurations in migration (#2033) 2026-01-05 22:30:10 +01:00
models fix: populate complete entity data in deletion event webhooks (#2135) 2026-01-24 12:50:18 +01:00
modules feat: add configurable gravatar-compatible base URL (#2083) 2026-01-13 14:58:08 +01:00
notifications fix(mail): disable queue when mailer disabled (#2069) 2026-01-08 15:51:31 +01:00
plugins feat(plugins): allow plugins to register routes 2025-08-01 17:06:02 +02:00
red fix: correct license header references (#882) 2025-06-10 12:18:38 +02:00
routes refactor: centralize HTTP error handling (#2062) 2026-01-08 10:02:59 +00:00
swagger [skip ci] Updated swagger docs 2025-12-15 15:44:47 +00:00
user fix: properly quote email sender names containing @ symbols (#1768) 2025-11-07 11:44:24 +01:00
utils fix(auth): retry up to three times when an auth provider cannot be reached 2026-01-05 21:50:40 +01:00
version fix: correct license header references (#882) 2025-06-10 12:18:38 +02:00
web refactor: centralize HTTP error handling (#2062) 2026-01-08 10:02:59 +00:00
webtests refactor: centralize HTTP error handling (#2062) 2026-01-08 10:02:59 +00:00