Files
swiftcontrol/test/utils
Jonas Bark c0ee01f4d8 fix(permissions): let the onboarding wizard always win at launch
The Local Network warning fired at startup and the wizard then opened over it.
_NavigationState.initState calls startEnabledConnectionMethod() synchronously,
while the onboarding push happens later in an async block — so the toast lands
first.

The deferral rule required *both* "onboarding not yet run" and "no connection
method enabled", so a pending wizard on a device that already had a method
switched on still probed. Every method setting defaults to false, so that
conjunction only ever differed in exactly this case: a rider re-entering the
wizard with an existing configuration. Drop it — if the wizard is about to take
the screen, defer, full stop. That also makes this gate and the
getScanRequirements one identical.

Guard inside startEnabledConnectionMethod() rather than at the navigation call
site, so trainer_setup.dart's two calls are covered as well; the wizard hits
those when the rider picks a trainer app, which is the same bug one step later.
Nothing is lost while onboarding runs: setOnboardingMethodEnabled starts its
servers directly.

hasAnyConnectionMethodEnabled goes with it — it existed only to feed the clause
that is now gone.

The regression test was checked both ways: with the guard stubbed out it fails
with Expected: empty / Actual: ['check'].

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 1eee7644213e93201f7073d97c74f13c593b4cde)
2026-08-21 10:31:20 +02:00
..
2026-05-05 14:15:27 +02:00