feat(app): preserve multiple saved devices#9311
Conversation
|
Thanks for pulling this into a much smaller, focused slice. Preserving multiple saved devices while keeping the active A couple of things I’d want checked before this moves out of draft / before maintainer merge review:
I’m not formally approving while this is draft and checks are unavailable, but this looks like a coherent and reviewable app-side improvement rather than the broad mixed scope from the earlier branch. |
|
Addressed draft review in 247950c. Changes:
Local checks:
|
|
Thanks for this clean, well-scoped slice — preserving multiple paired devices while keeping the legacy single-device fallback is the right architectural direction, and the migration path (empty list falls back to A few observations for you and the maintainer team:
The unit tests covering upsert dedupe, Not formally approving while this is draft and no CI checks are available, but this looks like a coherent and reviewable app-side improvement. |
Theory
Multi-device support failed because the app persisted one active BLE device and the onboarding scanner rendered only live scan results. A second saved device displaced the first, and offline saved devices disappeared from the connect flow.
Scope
SharedPreferencesUtil.btDeviceslist storage with legacybtDevicefallback.btDeviceSetupdating active device while preserving unique saved devices.OnboardingProvider.savedDeviceListandvisibleDeviceList.Cut from #9084
Tests
flutter test test/providers/onboarding_provider_multi_device_test.dartfailed on missingbtDevices,savedDeviceList, andvisibleDeviceList.flutter test test/providers/onboarding_provider_multi_device_test.dart.dart analyze lib/backend/preferences.dart lib/providers/onboarding_provider.dart lib/pages/onboarding/find_device/found_devices.dart test/providers/onboarding_provider_multi_device_test.dart.Notes
app/lib/pages/home/page.dart.