Skip to content

tech-debt: extract shared LoRa reconnect attempt + RF auto-connect runner #807

Description

@rinchen

Context

Follow-up from the 2026-08-06 24h change review on liam (e807892e^..HEAD). Controllers and production auto-connect routing landed; attempt bodies and ConnectionPanel serial/BLE paths remain duplicated.

Status (2026-08-06 audit): still needed — keep open. Goals 1–2 are partial; goal 3 is still needed (upstream PR only).

Goals

  1. Shared LoRa reconnect attempt runnerPARTIAL

    • Done: rfReconnectController single-owner schedule / link-lost / begin–end attempt (fix: packaging smoke path, RF reconnect ownership, and CI build-channel stamps #798); parity contract loraRfReconnectParity.contract.test.ts.
    • Still needed: extract the ~250–320 line parallel attemptReconnect / attemptMeshcoreReconnect bodies from useMeshtasticRuntime.ts / useMeshcoreRuntime.ts behind the controller (keep MeshCore TCP/burst MeshCore-only). Migrate off parallel legacy *IsReconnectingRef / *GenerationRef where safe. (~640 lines of mirrored attempt logic remain.)
  2. Shared RF auto-connect transport runnerPARTIAL

    • Done: useProtocolRfAutoConnect + ProtocolAutoConnectCoordinator own production auto-connect (feat: TCP/HTTP RF auto-connect and MeshCore SoftAP reconnect hardening #806); App mounts with suppressMountAutoConnect; TCP/HTTP in the hook; cancel-on-manual-connect.
    • Still needed: dedupe or delete the ~260-line serial/BLE mount auto-connect block in ConnectionPanel.tsx (still mirrored for the unsuppressed / test path). Prefer a shared transport-runner lib or drop the panel path once tests target the hook/coordinator.
  3. Upstream rsReticulum bond-desync overlaySTILL NEEDED (upstream process)

    • Done locally: overlay rsReticulum-ble-rnode-bond-desync.patch + apply scripts; mesh-client integration (fix: MeshCore SoftAP TX, hop goblins, Reticulum BLE bond desync #808).
    • Still needed: open/track upstream PR on ratspeak/rsReticulum (chains after pairing-transition-debounce / #20). scripts/update.sh RATSPEAK_PATCH_ENTRIES PR field is still empty; patches README: “no upstream PR yet”.

Related (lower priority in same epic)

  • Reticulum remediation i18n consolidation (connectionPanel.reticulumSidecarIssues.* vs diagnostics vs local-interface bond-stale copy)
  • Extract MeshCore TCP session / dead-bridge policy out of the large MeshCore runtime
  • Prefer pure-lib behavioral tests over expanding source-contract substring scans

Risk

High for reconnect extract (n7eal TCP / single-owner invariant). Do as a dedicated PR with existing loraRfReconnectParity.contract.test.ts + runtime reconnect tests green.

Highest-value remaining

  1. Extract reconnect attempt bodies behind the controller (high risk).
  2. Delete or share ConnectionPanel serial/BLE auto-connect now that App always suppresses it.
  3. Open/track upstream rsReticulum bond-desync PR (process, not local code).

Metadata

Metadata

Assignees

Labels

back-endIssues related to server-side logic, APIs, and backend servicesmajor changeSignificant change affecting core application functionality or structure

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions