Phase 1: ConnectionSupervisor, saved profiles, auto-reconnect - #20
Conversation
- Add ConnectionProfile dataclass (transport, host/port/address/serial) - Add ConnectionSupervisor: watches for CONNECTION_LOST, schedules exponential-backoff retries ([2, 5, 15, 30, 60] s), only fires after the radio was successfully connected at least once this session - Activate the RECONNECTING state (was defined but never emitted before) via a new enter_reconnecting() slot on MeshtasticWorker; allow RECONNECTING in connect_* state guards so supervisor-initiated retries can proceed - Add get_setting / set_setting to MonitorStore backed by the existing app_settings table (was in schema but never read/written) - Persist last-used connection profile on every successful connect; restore it into ConnectionBar on next launch - Stamp NetworkSession.transport / connection_target on first connect - Add intercepting handlers in MainWindow (_on_connect_tcp/ble/serial and _on_disconnect) that update the supervisor before calling the controller - Tests: test_monitor_store_settings (8 cases), test_connection_supervisor (17 cases); 391/392 suite-wide pass (pre-existing pyqtgraph gap) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 9 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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
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
ConnectionProfiledataclass — transport + host/port/address/serial fields, with aconnection_targetproperty for displayConnectionSupervisor— watches the controller forCONNECTION_LOSTand schedules exponential-backoff retries ([2, 5, 15, 30, 60]s). Only fires after the radio was successfully connected at least once this session (prevents retry loops on a mistyped host or unpaired device)RECONNECTINGstate activated — was defined in the enum and UI tables but never emitted; now set via a newenter_reconnecting()slot onMeshtasticWorker, and the connect guards accept it as a valid starting state for reconnect attemptsget_setting/set_settingwired to the existingapp_settingstable (was in schema since Phase 0 but never read or written); profile saved on every successful connect, restored intoConnectionBaron next launchNetworkSessionstamping —transportandconnection_targetnow updated on first connect and written to the DBMainWindowwiring — four intercepting handlers (_on_connect_tcp/ble/serial_requested,_on_disconnect_requested) callsupervisor.set_profile()/supervisor.cancel()before delegating to the controllerTest plan
tests/test_monitor_store_settings.py— 8 cases: missing key, round-trip, overwrite, empty string, numeric string, independent keys, persistence across restarttests/test_connection_supervisor.py— 17 cases: load_profile (None/tcp/invalid port), set/save profile, cancel,_on_connected,_on_error(lost→retry, no prior connect, wrong code, active retry increment),_attempt_reconnect(tcp/ble/serial/inactive)pyqtgraphnot installed in CI🤖 Generated with Claude Code