Skip to content

fix(alerts): sync cloud read-state to desktop reliably#27

Merged
proofofprints merged 1 commit into
mainfrom
claude/overmanager-alert-control-sync-dsu4ko
Jun 17, 2026
Merged

fix(alerts): sync cloud read-state to desktop reliably#27
proofofprints merged 1 commit into
mainfrom
claude/overmanager-alert-control-sync-dsu4ko

Conversation

@proofofprints

Copy link
Copy Markdown
Collaborator

Summary

  • Acking an alert in the cloud portal/mobile app wasn't marking it read on desktop, because the cloud's alert-read / alerts-read-all WS payloads couldn't be matched against local AlertEvents.
  • Two compounding bugs, fixed together with the OverCloud-side fix (overbuildlabs/OverCloud, same branch):
    1. minerId always null: the desktop posts alerts with the miner identifier under minerIp, but OverCloud's ingest schema only accepted minerId — so every alert from desktop landed in Postgres with minerId: null, and the cloud could never echo back a matching identifier.
    2. timestamp precision loss: desktop alerts carry nanosecond-precision RFC-3339 timestamps; round-tripping through Postgres (truncates to microseconds) and the WS broadcast re-encoding (milliseconds) drops precision, so exact-instant comparison in timestamps_match never matched.
  • This PR fixes Add device removal to ASIC and Mobile miners #2: timestamps_match now compares at whole-second granularity (DateTime::timestamp()), which is safe given alert cooldowns are 15–30 minutes — no realistic case where the same rule+miner fires twice in the same second.

Test plan

  • Existing unit tests in src-tauri/src/commands/alerts.rs (matches_on_rule_miner_and_timestamp, rejects_on_any_field_mismatch, timestamp_match_is_format_tolerant, mobile_device_id_matches_as_miner_id) cover the matching logic and remain valid against the new comparison granularity.
  • Manual: ack an alert in the cloud portal/mobile app and confirm it shows read on desktop within one sync cycle, and vice versa.
  • Note: full cargo test/build isn't runnable in this sandbox (missing system GTK/GDK dev libs for the Tauri GUI deps) — verify in CI/locally.

Companion fix: overbuildlabs/OverCloud#35 (commit 6bd0ddd, already on that PR's branch).


Generated by Claude Code

@proofofprints proofofprints merged commit 5f7f533 into main Jun 17, 2026
1 check 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.

2 participants