[PR #2360] [MERGED] fix: handle deleted user in saved filter view event listener #5628

Closed
opened 2026-04-16 13:44:45 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2360
Author: @tink-bot
Created: 3/4/2026
Status: Merged
Merged: 3/4/2026
Merged by: @kolaente

Base: mainHead: fix/handle-deleted-user-in-saved-filter-listener


📝 Commits (1)

  • 8d930fe fix: handle deleted user in saved filter view event listener

📊 Changes

1 file changed (+7 additions, -7 deletions)

View changed files

📝 pkg/models/listeners.go (+7 -7)

📄 Description

Summary

  • Fixes a crash in the UpdateTaskInSavedFilterViews event listener when the doer (user who created/updated a task) has been deleted
  • The named return err was set to ErrUserDoesNotExist by the user lookup, then never cleared because the := inside the for loop shadowed it — leaving the stale error as the function's return value and poisoning the event handler
  • Uses a separate userErr variable for the user lookup so the named return is not polluted

Closes #2359

Test plan

  • Verified the fix compiles cleanly
  • Trigger a task.created event where the doer no longer exists (e.g. deleted user) and confirm the handler completes without error

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2360 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 3/4/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix/handle-deleted-user-in-saved-filter-listener` --- ### 📝 Commits (1) - [`8d930fe`](https://github.com/go-vikunja/vikunja/commit/8d930fe7ba4746091fdeb08138db1825541d1dd8) fix: handle deleted user in saved filter view event listener ### 📊 Changes **1 file changed** (+7 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `pkg/models/listeners.go` (+7 -7) </details> ### 📄 Description ## Summary - Fixes a crash in the `UpdateTaskInSavedFilterViews` event listener when the doer (user who created/updated a task) has been deleted - The named return `err` was set to `ErrUserDoesNotExist` by the user lookup, then never cleared because the `:=` inside the for loop shadowed it — leaving the stale error as the function's return value and poisoning the event handler - Uses a separate `userErr` variable for the user lookup so the named return is not polluted Closes #2359 ## Test plan - [x] Verified the fix compiles cleanly - [ ] Trigger a `task.created` event where the doer no longer exists (e.g. deleted user) and confirm the handler completes without error --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 13:44:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5628