Skip to content

feat(backlog): watch tasks and notify watchers of changes - #34

Merged
somaraj merged 1 commit into
developfrom
feature/watch-tasks
Dec 1, 2026
Merged

somaraj merged 1 commit into
developfrom
feature/watch-tasks

Conversation

@somaraj

@somaraj somaraj commented Dec 1, 2026

Copy link
Copy Markdown
Member

What and why

Closes #15.

People who care about a task but don't own it (team leads, QA, the reporter) can now watch it and hear about changes instead of checking back.

Off by default. Turn it on under Configuration → Work items → Task watchers. E-mail watchers also sends each notification by e-mail.

  • Watch / Watching button in the task header, with the watcher count and a list of watchers.
  • Who watches: the creator, developer and tester automatically, plus anyone who comments or clicks Watch. Anyone can unwatch, and that choice sticks: commenting later doesn't re-subscribe you.
  • Notifications (bell, optionally e-mail) when the status, developer/tester or comments change. That includes changes from bulk update, merge-request webhooks and GitHub/GitLab issue sync.
    • Never sent for your own changes.
    • On reassignment the previous developer/tester is told; the new one is skipped because they already get the existing "assigned to you" e-mail.
  • Access: only members who can still see the task are notified, using the same rule as viewing it (project membership plus "view others' tasks", or being the developer/tester). Deleted or locked users are skipped.
  • Watching filter: bell menu → Tasks I'm watching opens the backlog filtered to exactly the tasks you follow, implicit ones included, minus anything you unwatched.

Design notes

  • No backfill. Creator, developer and tester are worked out when an event happens, so existing tasks work straight away. Rows are only stored for explicit follows and for opt-outs.
  • Rules are pure logic, in Core.Common.WatcherRecipients, with unit tests.
  • One service. IBacklogWatcherService is the single place every change path calls. It sends through the existing IUserNotificationService and logs failures rather than failing the save.
  • @mentions (@mentions in comments #14) can reuse AutoWatchAsync(…, WatchSource.Mentioned) and NotifyAsync.

Upgrade notes

  • Migration: new additive migration AddBacklogWatcher (table BacklogWatcher only). sql-scripts/01_schema.sql is regenerated.
  • Labels: re-run sql-scripts/03_locale.sql for the 9 new labels.
  • Nothing changes until the setting is turned on.

How it was tested

  • dotnet build src/Taskist.sln and dotnet test src/Taskist.sln pass: 437 tests, 10 new in WatcherRecipientsTests.
  • 29 end-to-end checks against the running app on a fresh database (schema plus seed scripts, admin plus two users, one of them not a project member):
    • disabled: no button, no bell link, no notifications
    • Watch/unwatch, watcher count and list
    • status change through the form, single-field save and bulk update
    • comments: plain-text excerpt, commenter auto-watched, commenter not notified
    • opt-out stays after commenting
    • actor never notified
    • non-member watcher gets nothing and is hidden from the list
    • reassignment tells the previous assignee and skips the new one
    • Watching filter for explicit, implicit and opted-out tasks
    • bell link resolves to the task
  • Not run end to end: the merge-request webhook and issue-sync paths (they build and reuse the same service).
  • Not checked in a browser: the button's appearance in light and dark themes.

Checklist

  • dotnet build src/Taskist.sln and dotnet test src/Taskist.sln pass
  • Entity changes come with an EF migration, and the migration is additive (no dropped columns, no rewritten data)
  • New UI text is added to sql-scripts/03_locale.sql
  • New menu entries or permissions are added to sql-scripts/02_defaults.sql (n/a, no new menu or permission)
  • No inline scripts or styles, no CDN links, no ViewBag/ViewData, no comments in .cs files
  • New dependencies are MIT, Apache or BSD licensed (n/a, none added)
  • This touches authentication, authorization, file uploads, outbound HTTP or query building: the new Watch / Watchers actions require the Backlog permission and CanViewTaskAsync, and the Watching filter is applied inside the existing project-access query

🤖 Generated with Claude Code

Watch / Watching toggle with watcher list in the task header, a Watching backlog filter, and in-app (optionally e-mail) notifications for status, assignment and comment changes. Creator, developer and tester watch implicitly; commenters auto-watch; opt-outs stick. Recipients are limited to members who can still see the task and never include the actor. Off by default (Configuration > Work items). Adds the BacklogWatcher table (additive migration AddBacklogWatcher).

Closes #15

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

@somaraj
somaraj merged commit f8b2b15 into develop Dec 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watch tasks

1 participant