Skip to content

UI: consume v3alpha watch streams for live updates #5492

Description

@siavashs

Parent: #5451
API dependencies: #5478, #5480, #5481, #5482

Summary

Consume AlertService and SilenceService server-streaming watch RPCs so the Mantine UI updates from stored mutations without polling, while honoring the API's bounded, node-local, non-durable semantics.

Stream integration

  • Use generated direct Connect clients for WatchAlerts, WatchAlertGroups, and WatchSilences; do not route streams through unary-only Connect-Query abstractions.
  • Tie every stream to route, component, and filter lifecycle using AbortSignal cleanup.
  • Process initial snapshots, explicit snapshot-complete markers, entered/updated/exited transitions, and monotonic node-local sequence numbers.
  • Reconcile stream messages into bounded page/query caches without duplicating resources or corrupting deterministic ordering.
  • Show unobtrusive live, reconnecting, and stale/resynchronizing state.
  • Keep manual refresh and unary list behavior as a functional fallback.

Resynchronization

On queue overflow, ResourceExhausted, disconnect, cancellation not initiated by navigation, Alertmanager restart, invalid cursor, or reconnection to another HA peer:

  1. Mark the affected view stale/reconnecting.
  2. Stop applying messages from the old stream.
  3. Invalidate the relevant unary/query cache.
  4. Establish a new watch and consume a fresh initial snapshot.
  5. Resume live state only after the snapshot-complete marker.

Do not promise durable replay or cluster-wide cursor continuity. Do not synthesize UI mutation events for time-only status changes that the watch API explicitly omits; derive time state locally or resnapshot when required.

Browser client-streamed alert ingestion is out of scope. Browser alert submission, if added later, remains unary.

Acceptance criteria

  • Alerts, alert groups, and Silences update correctly after stored create/update/delete/expire/replacement events.
  • Snapshot-to-watch handoff does not visibly lose or duplicate accepted mutations in supported scenarios.
  • Entered, updated, and exited filter transitions modify the correct view.
  • Overflow, restart, peer change, invalid cursor, and disconnect always trigger a fresh snapshot rather than silently continuing stale state.
  • Live state is not shown until an explicit snapshot-complete marker is received.
  • Navigation, filter changes, and repeated reconnects release streams, observers, and cache references.
  • Manual refresh/unary operation remains usable when streaming is unavailable.
  • Component tests use controllable generated streams; real-server tests cover ordering, overflow, cancellation, reconnect, and route prefixes.

Dependencies and related work

Likely code areas

  • new stream hooks and cache reducers under ui/mantine-ui/src/data/
  • Alerts/Silences live-state integration and indicators
  • generated stream test helpers and real-server fixtures

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions