Skip to content

fix(alerts): make alert-read sync outcome observable, fix offline queue gap#29

Merged
proofofprints merged 4 commits into
mainfrom
claude/overmanager-alert-control-sync-dsu4ko
Jun 18, 2026
Merged

fix(alerts): make alert-read sync outcome observable, fix offline queue gap#29
proofofprints merged 4 commits into
mainfrom
claude/overmanager-alert-control-sync-dsu4ko

Conversation

@proofofprints

Copy link
Copy Markdown
Collaborator

Why

While debugging why desktop→cloud alert-read sync appeared to do nothing, found that acknowledge_alert always returns Ok(()) regardless of whether the cloud push actually succeeded, and the success path has zero logging. There was no way to tell from the console whether an ack ever reached the cloud, or distinguish "it worked silently" from "it never ran" (e.g. clicking ack on an alert already marked acknowledged locally is also a silent no-op).

Also found a real latent bug while in here: the offline sync queue's SQLite CHECK constraint only allowed kind IN ('snapshot', 'alert', 'miners')'alert-read'/'alerts-read-all' were never added, so a queued ack while offline would fail to insert.

What

  • acknowledge_alert now logs the outcome of every branch: push succeeded, push failed (with the actual HTTP error), no api_key set, enqueue succeeded, enqueue failed.
  • Added 'alert-read' and 'alerts-read-all' to the queue table's CHECK constraint (+ migration for existing installs, mirroring the existing 'miners' migration pattern).

Test plan

  • Ack a fresh alert on desktop, confirm one of the new log lines fires and the right one for your setup.
  • Note: cargo check/build isn't runnable in this sandbox (missing system GTK/GDK dev libs) — review the diff; changes are two small, low-risk Rust edits (log calls + CHECK-constraint string literals).

Generated by Claude Code

claude added 4 commits June 16, 2026 12:31
…obile

acknowledge_alert previously only flipped the local flag — nothing reached the
cloud, so a read marked on the desktop never showed up on the web portal or
mobile app. It now POSTs the alert's (ruleName, minerIp, timestamp) tuple to
the new /ingest/alert-read endpoint after marking it locally, falling back to
the offline queue (drained by the sync loop) when offline or on failure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YYr4XG3SBHoSpP33d84Jqa
… queue

acknowledge_alert always returned Ok(()) regardless of whether the cloud
push succeeded, and the success path had no logging at all — making it
impossible to tell from the console whether an ack ever reached the cloud.
Also the offline queue's CHECK constraint never included 'alert-read' (or
'alerts-read-all'), so a queued ack while offline would silently fail to
insert.
…ert-control-sync-dsu4ko

# Conflicts:
#	src-tauri/src/commands/alerts.rs
@proofofprints proofofprints merged commit d0abdf9 into main Jun 18, 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