Skip to content

Cascade-archive notification parity: dispatch per-child WATCH_ARCHIVED notifications #166

Description

@gregoryfoster

Context

CR follow-up from #161 (item 7 in the round-1 review of docs/plans/2026-05-17-watched-item-crud-ui-plan.md).

The single-Watch danger-zone archive route at src/dashboard/routes.py:766-782 fires `_dispatch_archive_notification` for the archived Watch — operators get a notification when a Watch is archived.

The bulk WatchedItem archive (via src/api/routes/watched_items.py:80-118, called from both the API and the dashboard wrapper) cascades `is_active=False, is_archived=True` onto every child Watch and emits a `WATCH_ARCHIVED` audit row per child — but does not dispatch notifications. Operators watching for archive events on those Watches won't be notified.

This was a deliberate v1 omission to avoid notification floods on bulk archive (e.g. a WatchedItem with 30 children would fire 30 notifications), but it leaves operators with an inconsistent signal: single-Watch archive → notified; bulk WatchedItem archive → silent.

Scope

Pick a strategy:

  1. Dispatch per-child notifications inline during cascade — accept the flood risk; matches the single-Watch path.
  2. Emit one aggregate notification at the WatchedItem level ("Archived WatchedItem X — cascaded to N child Watches") — quieter, requires a new event type.
  3. Suppress per-child notifications during cascade, document the gap — keep current behavior, add explicit note in operator docs.

Recommend (2) — one event per cascade, with the child count in the payload. Requires:

  • New `WatchEventType.WATCHED_ITEM_ARCHIVED` (or similar).
  • Dispatch from `archive_watched_item` after the cascade loop.
  • A WatchedItem-level notification config / template might be required, or hijack the parent's notification dispatch path.

Acceptance

  • Decide and document the strategy.
  • If implementing (1) or (2): operators receive a notification when a WatchedItem is archived (and its children are cascaded), matching the per-Watch archive UX.
  • Audit log unchanged from current behavior (parent + per-child `WATCH_ARCHIVED` audits stay).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions