Skip to content

fix(reticulum): stop false Failed to apply setting on Remote Off - #780

Merged
rinchen merged 2 commits into
mainfrom
runr
Aug 3, 2026
Merged

fix(reticulum): stop false Failed to apply setting on Remote Off#780
rinchen merged 2 commits into
mainfrom
runr

Conversation

@rinchen

@rinchen rinchen commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Sidecar rncp disable now returns ok: true with listener status (matched enable contract); previously status alone made !res.ok treat a successful Off as failure.
  • Renderer treats Remote IPC failure only when ok === false via shared isRemoteOkFailure (Settings, enable-request modal, push policy).
  • Adds coverage for legacy status-without-ok Off success and explicit ok: false failure.

Diagnosed from Runr developer bundle: clicking Remote → Settings → Off toasted "Failed to apply setting" even though disable succeeded.

Test plan

  • Remote → Settings: enable Ask (re-pick save folder if prompted), then click Off — no error toast; Off stays selected
  • Click Off again while already Off — still no false failure toast
  • Ask with stale save dir after app restart — still prompts to re-choose folder (unchanged)
  • pnpm exec vitest run src/shared/remote-types.isRemoteOkFailure.test.ts src/renderer/components/remote/RemoteSettingsSection.test.tsx
  • cargo test --manifest-path reticulum-sidecar/Cargo.toml with_rncp_listener_ok_stamps_ok_true_on_status

Summary by CodeRabbit

  • Bug Fixes

    • Improved remote listener status handling for consistent success and failure responses.
    • Preserved compatibility with legacy successful responses that omit an explicit status field.
    • Failed listener operations now reliably display an error and avoid saving unsuccessful changes.
    • Listener status responses now consistently include a success indicator.
  • Tests

    • Added coverage for legacy responses, explicit failures, successful updates, and invalid status data.

Sidecar disable returned listener status without ok:true, so !res.ok
treated a successful Off as failure. Stamp ok on disable and only treat
explicit ok:false as failure in the Remote UI.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 53 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: b9a5a740-7d89-4d9f-8ad3-208141420e99

📥 Commits

Reviewing files that changed from the base of the PR and between 62fc001 and 01bc883.

📒 Files selected for processing (1)
  • reticulum-sidecar/src/stack/mod.rs
📝 Walkthrough

Walkthrough

The sidecar now marks successful RNCP listener disable responses with ok: true. Shared renderer logic treats only explicit ok: false responses as failures. Listener configuration and tests now support both legacy responses and explicit failure responses.

Changes

RNCP response handling

Layer / File(s) Summary
RNCP success response contract
reticulum-sidecar/src/stack/mod.rs
Listener disable responses add ok: true while preserving existing status fields. A unit test covers this behavior.
Remote response failure guard
src/shared/remote-types.ts, src/shared/remote-types.isRemoteOkFailure.test.ts
isRemoteOkFailure identifies explicit ok: false payloads. Tests cover legacy, successful, failed, and invalid inputs.
Listener failure handling
src/renderer/components/remote/RemoteSettingsSection.tsx, src/renderer/components/remote/RncpEnableRequestModal.tsx, src/renderer/lib/pushRncpListenerPolicy.ts, src/renderer/components/remote/RemoteSettingsSection.test.tsx
Listener and policy flows use the shared failure guard. Tests cover legacy success responses and explicit failure responses with toast and persistence checks.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary fix for the false failure reported when disabling Remote settings.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch runr

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
reticulum-sidecar/src/stack/mod.rs-2101-2103 (1)

2101-2103: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the stale response-contract comments.

isRemoteOkFailure now treats only explicit ok: false as failure. Both comments state that a missing ok value is a current UI failure condition. That statement is no longer correct.

  • reticulum-sidecar/src/stack/mod.rs#L2101-L2103: describe ok: true as an explicit success marker for the RNCP response contract.
  • reticulum-sidecar/src/stack/mod.rs#L2834-L2835: remove the statement that the UI treats missing ok as failure.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@reticulum-sidecar/src/stack/mod.rs` around lines 2101 - 2103, Update the
comments near with_rncp_listener_ok at reticulum-sidecar/src/stack/mod.rs lines
2101-2103 to describe ok: true as the explicit RNCP success marker; at lines
2834-2835 in the same file, remove the claim that missing ok is treated as a UI
failure. No runtime behavior changes are needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Other comments:
In `@reticulum-sidecar/src/stack/mod.rs`:
- Around line 2101-2103: Update the comments near with_rncp_listener_ok at
reticulum-sidecar/src/stack/mod.rs lines 2101-2103 to describe ok: true as the
explicit RNCP success marker; at lines 2834-2835 in the same file, remove the
claim that missing ok is treated as a UI failure. No runtime behavior changes
are needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: 9aadb733-6115-4dcf-8230-b701fe374cf9

📥 Commits

Reviewing files that changed from the base of the PR and between 906b128 and 62fc001.

📒 Files selected for processing (7)
  • reticulum-sidecar/src/stack/mod.rs
  • src/renderer/components/remote/RemoteSettingsSection.test.tsx
  • src/renderer/components/remote/RemoteSettingsSection.tsx
  • src/renderer/components/remote/RncpEnableRequestModal.tsx
  • src/renderer/lib/pushRncpListenerPolicy.ts
  • src/shared/remote-types.isRemoteOkFailure.test.ts
  • src/shared/remote-types.ts

@rinchen
rinchen merged commit d98a956 into main Aug 3, 2026
21 checks passed
@rinchen
rinchen deleted the runr branch August 3, 2026 14:52
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