Skip to content

Simplify notifications: drop Read state, suppress deploy noise#366

Merged
Wiesenwischer merged 1 commit intomainfrom
feature/notification-simplification
Apr 17, 2026
Merged

Simplify notifications: drop Read state, suppress deploy noise#366
Wiesenwischer merged 1 commit intomainfrom
feature/notification-simplification

Conversation

@Wiesenwischer
Copy link
Copy Markdown
Owner

Summary

Two pain points in the notification dropdown addressed together:

  1. Read vs. dismissed lifecycle was confusing. Users could mark all as read but had to dismiss each item individually, yet notifications live in a 50-entry in-memory FIFO anyway — the read state didn't earn its keep. Merged into a single lifecycle: notifications stay visible until dismissed; a new Dismiss all button replaces Mark all as read.
  2. Product deploys emitted duplicate-feeling notifications. The real source was HealthChangeTracker firing one notification per service per transition. Two mitigations:
    • ProcessHealthUpdateAsync now accepts suppressNotifications, wired from Deployment.IsInProgress in HealthCollectorService (defensive — the Running-only filter would already block today, but keeps the intent explicit).
    • New ResetBaselineAsync hook, called whenever HealthCollectorService encounters a deployment in any non-Running status. After redeploy/upgrade, the first recovery cycle starts from a clean baseline and no longer emits spurious pre-upgrade → post-upgrade transition notifications.

Breaking API changes

  • Notification.Read field removed.
  • POST /api/notifications/{id}/read — removed.
  • POST /api/notifications/read-all — removed.
  • GET /api/notifications/unread-countGET /api/notifications/count.
  • DELETE /api/notifications — added.

AMS UI consumes @rsgo/core via file-link and must be updated in lockstep. A companion plan lives at ReadyStackGo.Ams/docs/Plans/PLAN-notification-simplification.md.

Test plan

  • dotnet build — 0 errors, 5 pre-existing warnings.
  • dotnet test — 2876 tests pass, including new cases for SuppressNotifications, ResetBaseline (fresh-baseline, scoped-to-target, unknown-deployment).
  • pnpm -r build in src/ReadyStackGo.WebUi — green.
  • Smoke: deploy a multi-service product, confirm only the final ProductDeploymentResult lands (no per-service HealthChange spam).
  • Smoke: verify dropdown shows uniform item styling, Dismiss all clears everything, badge uses total count.
  • Update AMS UI NotificationDropdown.tsx before releasing a combined distribution.

- Remove Read flag from Notification; merge read/dismissed into a single
  lifecycle so notifications stay in the dropdown until dismissed.
- API: remove mark-as-read and mark-all-as-read endpoints, rename
  /api/notifications/unread-count to /count, add DELETE /api/notifications
  for bulk dismiss.
- HealthChangeTracker gains suppressNotifications flag (passed from
  HealthCollectorService when Deployment.IsInProgress) and a
  ResetBaselineAsync hook so the tracker clears tracked baselines whenever
  a deployment leaves Running. After redeploy/upgrade the first recovery
  cycle now starts from a clean baseline and no longer emits spurious
  pre-upgrade -> post-upgrade transition notifications.
- Frontend: NotificationDropdown shows every visible notification with
  the same styling, replaces "Mark all as read" with "Dismiss all", and
  drops read/unread fields from the core API client and hook.
@github-actions github-actions Bot added the feature New feature or enhancement label Apr 17, 2026
@Wiesenwischer Wiesenwischer enabled auto-merge (squash) April 17, 2026 06:59
@Wiesenwischer Wiesenwischer merged commit 2fc7e52 into main Apr 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant