Benachrichtigung bei neuem Kommentar auf einem zugewiesenen Todo #163
Labels
No labels
priority/could
priority/must
priority/should
priority/wont
status/blocked
status/claimed
status/done-migrated
type/bug
type/feature
type/infra
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
robert/todo#163
Loading…
Reference in a new issue
No description provided.
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?
Story: Benachrichtigung bei neuem Kommentar auf einem zugewiesenen Todo
As a Mitglied, dem ein Todo zugewiesen ist,
I want to benachrichtigt werden, wenn jemand einen Kommentar dazu schreibt,
so that ich Nachrichten fuer mich nicht verpasse, ohne jedes Todo einzeln erneut oeffnen zu muessen.
Background
CreateCommentCommandHandler.cshat aktuell keinerlei Anbindung an die bestehende Notification-Pipeline (In-App-Glocke, Push, E-Mail, Digest) - ein Kommentar auf einem Todo bleibt fuer den Assignee vollstaendig unbemerkt, bis er das Todo zufaellig erneut oeffnet. Die Infrastruktur dafuer (NotificationEntity,CreateNotificationCommand,NotificationKind-Enum, Push/E-Mail-Zustellung) existiert bereits vollstaendig und wird fuer aehnliche Faelle (z. B.TodoAssigned,AddedToList) schon genutzt.Acceptance criteria:
CreateNotificationCommand/NotificationKind-Infrastruktur statt eines neuen Zustellwegs.Out of scope for this story:
Open questions: (escalate to human if unanswered)
Claiming this. Plan: add a
TodoCommentCreatedNotificationDecorator-style hook (or an inline call, matching whichever patternCreateTodoCommandHandler's existingTodoAssigned/AddedToListnotification call sites use) insideCreateCommentCommandHandlerthat, after a comment is persisted, checks the todo'sAssigneeId: if set and not equal to the comment's author, firesCreateNotificationCommandwith a newNotificationKind.TodoCommented(or equivalent existing-pattern name) carrying the todo's title, mirroring the existing "X commented on 'Todo-Titel'" text convention. Will reuse the existing Push/E-Mail dispatch path already wired toCreateNotificationCommand- no new delivery mechanism. No open questions on the issue itself, so proceeding directly to implementation.Implemented and merged in commit
0888176on master.Scope:
CreateCommentCommandHandlernow fires aNotificationKind.TodoCommentednotification for a todo's assignee whenever a new comment is added, unless the assignee is the comment's own author. MirrorsAssignTodoCommandHandler's existing notification-trigger pattern exactly: body text is"{authorDisplayName} commented on '{title}'", delivered via the existingCreateNotificationCommand/NotificationKindinfrastructure (no new delivery path) - push and in-app WS delivery are already generic across all notification kinds, and email stays unchanged (onlyTodoDueToday/TodoOverdueget instant email, matchingTodoAssigned's own existing scope - not extended here per AC bullet 3).Out of scope, as specified: Pantry/MasterPacking comments (no assignee concept there), @mentions, and notifying non-assignee members - none implemented.
Tests: 3 new backend unit tests (notifies a different assignee, suppresses when the assignee is the comment's own author, suppresses when there's no assignee) - all confirmed to reach the expected
DockerUnavailableExceptionin this sandbox (no Docker available), proving DI wiring is correct.Verification:
dotnet buildclean; full frontend suite green (125 files/1175 tests, unchanged - the only frontend change is an additive TS union member for the new notification kind, which needs no new UI logic sinceNotificationItem.tsxrendersbody/kindgenerically);tsc -b/npm run buildclean. A dedicated security-review pass found no IDOR (recipient is derived server-side from the todo's own current assignee, never client input) or injection issues (body is plain-text, rendered as a JSX text child, and only exposes information already visible to any list member via the todo's own comment list).Closing as done.