Files
swiftcontrol/lib/bluetooth
Jonas Acker 07c400d975 fix(trainer): a failed WiFi upstream connect no longer crashes the app
Changing the control protocol cycles the bridge via
ProxyDevice.reconnectUpstream, which rethrew a failed connectDevice. Every
caller fires it from a UI callback nobody awaits (protocol select
onChanged, "Use auto" button), so a DirCon host lookup failure
(SocketException: Failed host lookup '<trainer>.local') surfaced as an
uncaught "App crashed" error. Same for picking a bridge mode on the
ConnectionCard of a disconnected trainer (_onSelect from onChanged).

Both now record the error via recordError and alert the rider;
Connection._connect has already logged it and reset the device, and the
usual rediscovery reconnects the trainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:28:06 +02:00
..