fix(alerts): sync cloud read-state to desktop reliably#27
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
alert-read/alerts-read-allWS payloads couldn't be matched against localAlertEvents.minerIp, but OverCloud's ingest schema only acceptedminerId— so every alert from desktop landed in Postgres withminerId: null, and the cloud could never echo back a matching identifier.timestamps_matchnever matched.timestamps_matchnow 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
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.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