Files
swiftcontrol/test/integration
Jonas Acker 86995cd69f fix(trainer): dispose the trainer's definition when it is detached
A virtual-shifting bridge starts a periodic notify pump on the trainer's
FitnessBikeDefinition. Disconnecting (and switching VS to proxy, and the
start-failure path) only detached the definition from the shared emulator;
nothing ever disposed it, so the pump kept firing and held the definition
alive. A connection builds a fresh definition, so every drop/reconnect left
one more pump behind — on a trainer that drops every minute they pile up
over a ride.

All three detach sites now go through one helper that detaches and then
disposes. Dispose only cancels the definition's timers; its notifiers stay
readable, so the gear remembered across a reconnect is unaffected.

Tests (through the real connect / in-place disconnect / reconnect path):
the old definition's pump is stopped on disconnect and stays stopped after a
reconnect builds a new one; the rider's gear still survives the reconnect.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 11:34:13 +02:00
..