Repository navigation
Connect lists only devices found in the current Bluetooth scan - #26539
Merged
Merged
Conversation
…scan Saved devices that are not advertising no longer appear as Offline rows. OnboardingProvider.onDevices now notifies when the list empties so a device that goes out of range leaves the screen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
DeviceService adds the stored device to its device list when it reconnects without a scan; subscribe() handed that list to the Connect page, which then showed the saved Omi as nearby. Subscribers now get only scanned devices. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
kodjima33
added a commit
that referenced
this pull request
Nov 28, 2026
## What `Device Scan Empty` fires when Connect still has no device after 10 s. It doesn't say why. A companion event, `Device Scan Empty Diagnosis`, now fires with it: - `scan_outcome`: the latest BLE scan in the window (started after Connect opened, or already running when it opened): `not_started`, `unfinished`, `blocked` (adapter or permission), `failed` (native rejected it) or `completed`. - `peripherals_seen`: distinct BLE advertisers (by peripheral id, named or anonymous) that completed scan heard, before any name or supported-device filter. Always 0 unless the outcome is `completed`, so an earlier scan's count never carries over. With `completed`, 0 means the radio heard nothing. Above 0 means advertisers were heard but no supported Omi. `startScan` is now awaited so a native rejection reports `failed`. DeviceService already catches each discoverer's errors, so the page behaves as before. The existing event is unchanged (its properties are immutable), so the onboarding funnel consumer is untouched. ## Why Nik's real-device acceptance test of #26539 on 1.0.602: Forget Device, then Connect. Three Connect opens on builds 1647 and 1648 each fired `Device Scan Empty`, and the page showed "No Omi Found" for over a minute. Nik's same phone and pendant re-paired within ~20 s on build 1644 (Nov 27 20:05–20:16 UTC). Upload timing maps 1647 to `12eda380`, before #26539, and nothing in the scan path changed between 1644 and 1647. So #26539 is probably not the cause, and the current telemetry can't tell the remaining causes apart. This event will on the next failure. ## Tests - `flutter test test/providers/onboarding_provider_pairing_presentation_test.dart test/utils/analytics/onboarding_funnel_analytics_test.dart test/services/` (Flutter 3.44.5): the empty-scan test asserts `scan_outcome: not_started` and `peripherals_seen: 0`. - New `test/unit/native_bluetooth_discoverer_scan_outcome_test.dart` covers completed (count), unfinished, blocked and failed, including that blocked and failed clear an earlier count, that a scan already running when Connect opens reports its real result, that a scan finished before Connect opened is ignored, and that anonymous advertisements count without becoming devices. `flutter test test/unit/ test/providers/ test/services/devices/`: 5744 passed. One file, `listen_custody_test.dart`, fails to load locally both with and without this change, because `dev_env.g.dart` isn't generated in this worktree. - `python3 scripts/check_event_registry.py`: generated output current, consumer executable, PostHog delta $+0. UI-Evidence: none -- telemetry only; the Connect page renders the same ## Failure class Failure-Class: none The only `fix:` commit corrects code added earlier in this PR. Nothing shipped. ## Product invariants affected none 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Connect (find devices) page listed every Omi the phone had ever paired, as "Offline" rows, even when none were nearby. It now lists only devices advertising in the current Bluetooth scan. A saved device that is nearby still sorts first with its "Saved" tag.
OnboardingProvider.visibleDeviceList: saved devices are included only when the scan sees them.onDevicesnow notifies listeners when the list empties, so a device that goes out of range leaves the screen instead of staying stale.Removed the offline-row branch (Offline chip, "wake your device" toast) from
found_devices.dart, and its now-dead test helper.DeviceService.subscribe()handed subscribers its whole device list, which also holds the stored device added for background reconnect without a scan. The Connect page then showed that saved Omi as nearby. Subscribers now get only devices the last scan saw.Saved devices are still stored and used for reconnect; only the list is filtered.
Screenshot
Simulator, 5 saved Omis seeded, none advertising: no device rows. The Bluetooth dialog is the simulator having no Bluetooth.
Tests
flutter test test/providers/ test/widgets/onboarding_polish_test.dart: 1397 passed (updated multi-device and pairing-presentation expectations, new test for the empty-list notify).flutter test test/services/: passed, incl. new test that a reconnect-only stored device is not handed to subscribers.make preflightpassed.Product invariants affected
none
🤖 Generated with Claude Code