fix(cloud): repair cloud-feature login tests and clippy errors#83
Conversation
PR #75 added a gate that rejects `POST /cloud/login/start` with 409 when cloud is disabled. Two login tests built their `AppState` through `cloud_test_state`, which hard-codes `cloud.enabled = false`, so after #75 they hit that gate. The start test asserted 201 and got 409; the poll test then panicked on the `login_id` missing from the 409 error body. The `cloud` feature carries no CI coverage, so the regression reached main unnoticed. Point both tests at `cloud_test_state_with_cloud` with cloud enabled and drop the now-unused `cloud_test_state` wrapper. Co-Authored-By: Nova (Claude Opus 4.7) <noreply@anthropic.com>
Clippy's `duration_suboptimal_units` flags `Duration::from_secs` calls whose values land exactly on a larger unit. `cloud_socket.rs` built a 3600-second heartbeat ceiling and a 60-second reconnect cap that read more clearly as one hour and one minute. Switch to `Duration::from_hours(1)` and `Duration::from_mins(1)`, and update the matching `cloud_socket_tests.rs` assertions. The durations are unchanged. These lints had accumulated because the `cloud` feature has no CI lint pass. Co-Authored-By: Nova (Claude Opus 4.7) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
Post-merge verification of the codex security batch surfaced two
latent defects in
cloud-gated daemon code. Thecloudfeature hasno CI coverage (no build, test, or lint pass), so both shipped to
mainunnoticed.1. Login test regression (from #75)
#75 added a gate that rejects
POST /cloud/login/startwith409when cloud is disabled. Two tests built their
AppStatethroughcloud_test_state, which hard-codescloud.enabled = false:cloud_login_start_stores_session_without_returning_device_codeasserted
201and got409.cloud_login_poll_keeps_pending_session_retryablethen panickedon the
login_idabsent from the409error body.Both now use
cloud_test_state_with_cloud(.., true); the unusedcloud_test_statewrapper is removed.2. Clippy
duration_suboptimal_unitserrorscloud_socket.rsandcloud_socket_tests.rsconstructed durationswith
Duration::from_secs(3_600)/from_secs(60), which clippyrejects at
-D warnings. Switched toDuration::from_hours(1)andDuration::from_mins(1)— identical durations, no behavior change.Verification
cargo test -p hypercolor-daemon --features cloud --test cloud_api_tests --test cloud_socket_tests— 26 + 11 passed (was 24 passed / 2 failed before)
cargo clippy -p hypercolor-daemon --features cloud --tests— clean(was 5 errors)
cargo clippy -p hypercolor-daemon --tests(no cloud) — cleancargo fmt --all --check— clean🤖 Generated with Claude Code