Skip to content

feat(alerts): per-device mute/snooze with timeframe#17

Merged
proofofprints merged 1 commit into
mainfrom
feat/mute-alerts
Jun 7, 2026
Merged

feat(alerts): per-device mute/snooze with timeframe#17
proofofprints merged 1 commit into
mainfrom
feat/mute-alerts

Conversation

@proofofprints
Copy link
Copy Markdown
Collaborator

What

Silence alerts for a device that's intentionally down (e.g. a mobile miner turned off on purpose) without removing it. Priority feature of the v1.6 batch.

Backend

  • New commands/mute.rs: muted_devices.json map keyed by IP (ASIC) / device_id (OverMobile), value { mutedUntil: Option<i64> }. None = until re-enabled; Some(epoch_ms) auto-expires. Persisted with an atomic write (tmp + rename).
  • Commands set_device_mute(id, mutedUntil), clear_device_mute(id), get_muted_devices() — registered in lib.rs. get_muted_devices prunes expired entries (auto-clear).
  • Alert engine: check_alerts + check_mobile_alerts skip muted devices — no alert, no notification, no cloud push; expired mutes excluded automatically.

Frontend

  • MuteControl.tsx dropdown: 1h · 4h · 24h · Custom date/time · Until I re-enable, doubling as the Muted until … badge so it's obvious why a device is quiet.
  • Wired into the ASIC (MinerDetail, keyed on IP) and OverMobile (MobileMinerDetail, keyed on deviceId) detail pages.

Verification

  • cargo check ✅ · npx tsc --noEmit
  • Runtime: user to confirm a muted device stops firing alerts and the badge shows the expiry. (Sandbox can't see the dev binary's muted_devices.json writes.)

Deferred (nice-to-have from the spec)

  • Central 'Muted devices' list / filter on the Alerts screen — each device is already clearable from its detail page; can follow up if wanted.

Let a user silence alerts for a device that is intentionally down (e.g.
a mobile miner turned off on purpose) without removing it.

- New commands/mute.rs: muted_devices.json map keyed by IP (ASIC) /
  device_id (OverMobile), { mutedUntil: Option<i64> }. None = until
  re-enabled; Some(ts) auto-expires. Atomic write (tmp + rename).
- Commands set_device_mute / clear_device_mute / get_muted_devices,
  registered in lib.rs. get_muted_devices prunes expired entries.
- Alert engine (check_alerts + check_mobile_alerts) skips muted devices:
  no alert, no notification, no cloud push.
- MuteControl.tsx dropdown (1h / 4h / 24h / custom date-time / until
  re-enabled) doubling as the 'Muted until …' badge, wired into the
  ASIC and OverMobile detail pages.
@proofofprints proofofprints merged commit a0e5d45 into main Jun 7, 2026
1 check passed
@proofofprints proofofprints deleted the feat/mute-alerts branch June 7, 2026 05:04
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.

1 participant