Skip to content

keep-desktop: split frost_event_listener into per-family node-event handlers#823

Merged
kwsantiago merged 1 commit into
mainfrom
refactor/desktop-frost-event-listener
Jul 16, 2026
Merged

keep-desktop: split frost_event_listener into per-family node-event handlers#823
kwsantiago merged 1 commit into
mainfrom
refactor/desktop-frost-event-listener

Conversation

@kwsantiago

Copy link
Copy Markdown
Contributor

frost_event_listener had grown to ~340 lines: a select! loop whose event branch carried a ~30-arm KfpNodeEvent match (logging + UI-queue pushes) alongside the sign-request rate-limit branch. This splits it into focused handlers.

Changes

  • frost_event_listener (340 → 35 lines) is now just the loop and select!, delegating each branch.
  • handle_sign_request holds the rate-limit + pending-request-enqueue branch, returning ControlFlow (Break on channel close, Continue on rate-limit rejection).
  • handle_node_event computes now_secs, maps RecvError (Lagged → Continue, Closed → Break), and dispatches the event. Its match lists every KfpNodeEvent variant with no _ catch-all, so exhaustiveness stays compiler-enforced: a new event variant will fail to compile until it is handled.
  • The event arms are grouped into per-family handlers via @-bindings: handle_peer_signing_node_event, handle_descriptor_node_event / handle_descriptor_status_node_event / handle_descriptor_health_node_event, and handle_psbt_node_event / handle_psbt_status_node_event. The inline log! macro was replaced with direct push_log(...) calls.

Every resulting function is under 100 lines.

Behavior

Pure code motion. Arm bodies are verbatim (only log!(a, b)push_log(frost_events, now_secs, a, b), and the extra & dropped where helper params are already references). Event ordering, logging, UI-queue pushes, and the rate-limit / pending-request logic are unchanged.

Verification

  • cargo clippy -p keep-desktop --all-targets: clean.
  • keep-desktop suite: 65 passed.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kwsantiago, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3676487e-1bf9-437b-8175-3af887c54bc2

📥 Commits

Reviewing files that changed from the base of the PR and between c77314b and b7fd720.

📒 Files selected for processing (1)
  • keep-desktop/src/frost.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/desktop-frost-event-listener

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kwsantiago kwsantiago merged commit b382711 into main Jul 16, 2026
9 checks passed
@kwsantiago kwsantiago deleted the refactor/desktop-frost-event-listener branch July 16, 2026 02:59
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