fix(app): stop forcing CV1 onboarding on omi-enumerated non-CV1 devices#9274
Merged
Conversation
The interactive device onboarding (CV1 button tutorial: single-press, power-cycle, double-tap) was force-shown when a Friend Dev Kit connected. DevKit boards enumerate as DeviceType.omi, and the skip gate relied on isOmiDevKit, which only matched 'DEVKIT' (no space) — so 'Friend Dev Kit 1' slipped through and got the consumer-pendant tutorial. Gate on isOmiCv1 instead (its documented purpose is scoping CV1-only UI), so onboarding fires only for a positively identified CV1. This also skips Glass/Neo/Friend, which likewise share DeviceType.omi. Also fix isOmiDevKit to recognize the spaced 'DEV KIT' spelling, matching its siblings isOmiCv1/getDeviceImagePath, so the latent trap can't bite a future caller. Test: flutter test test/utils/device_test.dart -> 22/22 pass, including the literal 'Friend Dev Kit 1' name from the report.
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.
Problem
Connecting a Friend Dev Kit 1 force-showed the interactive device onboarding — the CV1 consumer-pendant button tutorial (transcription demo → single-press → power-cycle → double-tap config). That tutorial is meant only for the CV1 pendant.
Cause
DevKit boards (and Glass / Neo / Friend) share the omi BLE service UUID, so they all enumerate as
DeviceType.omi. The onboarding gate in_checkDeviceOnboardingtried to skip DevKits viaDeviceUtils.isOmiDevKit, but that helper only matched the substringDEVKIT(no space):The device advertises "Friend Dev Kit 1" →
"FRIEND DEV KIT 1", which contains"DEV KIT"(spaced) but not"DEVKIT". So the skip didn't fire and the CV1 tutorial was shown. This contradicted the sibling helpersisOmiCv1(excludes'DEV KIT') andgetDeviceImagePath, which already treat the same device as not a CV1.Fix
lib/pages/home/page.dart— flip the gate from deny-listing DevKit to allow-listing CV1:isOmiCv1's documented purpose is "scoping CV1-only UI like the button tutorial" — exactly this flow. Onboarding now fires only for a positively-identified CV1, and also correctly skips Glass / Neo / Friend.lib/utils/device.dart—isOmiDevKitnow also matches the spaced"DEV KIT"spelling. It's no longer called inlib/after (1), but it's a public helper that carried the same space bug — this removes the latent trap and makes it consistent with its siblings.test/utils/device_test.dart— regression tests for the spaced"Friend Dev Kit 1"form in bothisOmiDevKitandisOmiCv1groups.Verification
flutter test test/utils/device_test.dart→ 22/22 pass, includingisOmiCv1(deviceName: 'Friend Dev Kit 1') == false(the assertion that would have caught this bug).flutter analyze lib/pages/home/page.dart lib/utils/device.dart test/utils/device_test.dart→ no new issues (remaining infos are pre-existing, far from the edited gate).🤖 Generated with Claude Code