Repository navigation
feat(app,firmware): rename an Omi and keep the name on the device - #13182
singhharsh1708 wants to merge 16 commits into
Conversation
Custom names are stored per device id, separate from the deviceName preference that mirrors the advertised BLE name and is rewritten on every connect. Unpairing clears the override for that device only.
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…lled Reset the saving state if the write throws, and block cancel and other dismissal paths while it is in flight so a cancelled dialog cannot report failure after the name was already stored.
|
Both fixed in 3ae6a22. A failed write now clears isSaving instead of leaving the spinner stuck, and cancel is disabled behind PopScope while the save is in flight so it can't report failure after the name was stored. |
|
Screens for this. These are the real widgets rendered through a golden test, not a device recording, since I don't have an Omi here. Device Settings with a custom name set, the row is now tappable: The dialog with a name typed, and empty. The hint is the advertised name, so clearing the field puts the original name back: |
The issue asks for the name on connect or pair, and the discovery list still rendered the advertised name. The duplicate-name suffix rule moved into DeviceUtils.listLabel so both it and the resolved name are tested.
|
Thanks @singhharsh1708 - this is a careful implementation and the sharpest of the three attempts at #2824 so far. I reviewed the full diff; notes below. What I verified:
For the maintainer, the one open question is scope, not correctness: the name lives only on this phone. #2824 is a long-open bounty ask, and the two prior attempts (#3111, #5952) stalled - if app-local naming is the accepted scope for now, this implementation is clean and well tested; if the name should follow the device across phones, that needs the firmware-side settings key/characteristic this PR deliberately leaves out. Leaving that direction call to a human maintainer. Minor, non-blocking: there is no length cap on the custom name - every display site ellipsizes, so this is fine in practice; mention only if you want a cap later. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Mobile feature (rename paired device), clean diff with tests, no abuse signals. Feature -> approve only per policy.
|
Thanks for the review @kodjima33. Two things before this lands: #2824 is still assigned to @krushnarout from October, and this keeps the name on the phone rather than the pendant, which is what @aaravgarg asked for on #3111. Happy either way, just want to know whether that scope counts for the bounty or if you'd rather have the firmware half first. |
The chip only ever held a short advertised name before, so it had no ellipsis and no Flexible. A 55 character custom name overflowed the row by 516 pixels. The chip now shrinks and ellipsizes, and the rename field caps input at 32 characters.
|
Follow-up after the final commit (118b824) — this lands on top of the earlier verification at 8111747, so only what changed:
What's left is the scope ruling @singhharsh1708 asked for: whether app-local naming counts as the accepted scope for #2824's bounty or the firmware-stored half comes first. @kodjima33 approved the app half at 8111747 and the delta since is only the overflow fix above, but #2824 is still assigned to @krushnarout, so the bounty/ownership ruling is the one open maintainer decision. by AI on behalf of David. The only open item here is the #2824 scope/bounty ruling — a normal maintainer call for @kodjima33/@krushnarout, no urgent escalation needed. |
The dialog now notes that the name is stored on this phone only, offers Reset to default once a custom name exists, and confirms a save. Only the note is a new string; the save and reset copy reuse nameUpdatedSuccessfully and resetToDefault, which every locale has.
# Conflicts: # app/lib/utils/device.dart
|
Follow-up at 0229266, covering only what landed since the last verification pass at 118b824: the storage-disclosure commit (23e7cf1) and the merge of main.
Still open for a maintainer, same as before: the #2824 scope/bounty ruling @singhharsh1708 asked about (phone-local naming vs the firmware-stored half from #3111), and a quick re-confirm from @kodjima33 — the approval was given at 8111747, and the disclosure/reset commit plus a main merge landed after it. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
No code change. The file already failed clang-format on main, and CI checks every changed firmware file as a whole.
A read/write characteristic on the settings service (19B10015) keeps a user-chosen name in NVS under omi/device_name, so any phone that connects can read it back. The payload starts with a version byte: a write is [1, name bytes...] with up to 128 name bytes, a lone [1] clears it, and a read returns [1] plus the stored bytes. The advertised name is left alone, so the name is never broadcast to nearby scanners and discovery, the advertisement budget and name-based device detection are unaffected. Feature bit 10 advertises it. The new characteristic is appended after the charging status CCC so existing attribute indices do not move.
…e it When the device advertises feature bit 10, renaming writes the name to the Omi and only keeps it on this phone once a read back matches, so a failed write leaves the old name and shows an error. On connect the name stored on the Omi replaces this phone's copy, including an empty one, so a name cleared from one phone is not resurrected by another. An empty read is treated as a failed read rather than an empty name, because the BLE transport returns [] on errors. Older firmware keeps the phone-only rename.
|
Added the firmware half: the name is now stored on the Omi (settings characteristic 19B10015, kept in NVS), so a new phone reads it back after connecting. I left the advertised name as it is so a personal name isn't broadcast to every phone nearby. The details, and what still needs a real build and a device pass, are in the description. |
|
Follow-up at e634d3a, covering the firmware half added since the last verification pass at 0229266 (the app half at 8111747/118b824/0229266d was verified earlier; only the delta below). Firmware (omi/firmware/omi):
App/firmware contract:
The one real gap is the one you flagged: nothing compiles this firmware. CI is green on all 14 checks but none of them build omi/firmware, and the NCS 2.9.0 Docker build did not fit your machine. The changes mirror the existing dim_ratio handlers closely and read cleanly, but a real build and an on-device pass should precede merge - and the earlier approval covers only the app half, so the firmware delta needs a maintainer look regardless. The #2824 scope/bounty ruling also remains open. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
@kodjima33 since your approval this also stores the name on the Omi itself (a settings characteristic backed by NVS), which is what #3111 asked for, and the firmware builds with the release workflow's Docker build. CI is green and it merges cleanly. Would you mind taking another look? |
# Conflicts: # app/lib/providers/device_provider.dart
|
Merged main in. Only conflict was _onDeviceConnected picking up the generation fencing, so the stored name read now runs under the same admitted generation. Full suite, ratchet and preflight rerun on the merge, numbers in the description are from those runs. |
…nnect-time sync A device whose storage has never been written reads back an empty name. That was adopted as authoritative and deleted the name the user set on this phone, which happens after a firmware upgrade, after a single failed features read, and when the rename dialog is opened before feature detection finishes. The first sync with such a device now pushes the local name up instead. The sync also runs under the connect generation, the input is capped by the 128 byte payload budget rather than 32 characters, and a save that throws reports the failure.
|
Pushed 8ed122e, which fixes a case where this feature could take a name away instead of keeping it. A device whose storage has never been written reads back an empty name, and that was being adopted as authoritative, deleting the name on this phone. No race needed to hit it: rename on firmware without bit 10, take an OTA to a build that has it, and the first connect afterwards wipes the name. A failed features read and renaming before Device Settings finishes feature detection end the same way, since saveToDevice is null and the save stays local. The first sync with a device that has never stored a name now writes the local name up to the Omi instead of clearing it, recorded per device id so a name genuinely cleared from another phone still clears here. Three smaller ones in the same commit: the sync was the only await chain in _onDeviceConnected without a generation fence, so it could notify a disposed provider or write back a name unpair had just cleared; the 32 character cap counts grapheme clusters, so 11 Tamil characters exceeded the 128 byte payload and failed behind an error the user could never clear, and the field is now capped by the same byte budget the firmware enforces; and a save that threw showed no error at all. Five tests, each checked against the previous head. Suite 2435 passed, ratchet passed, preflight 20 checks. The firmware is unchanged since the Docker build quoted above, so that evidence still stands at this head. |
|
@Git-on-my-level need human response The code side is done as far as I can take it: the firmware stores the name, any phone that connects reads it back, CI is green, and the review notes from your earlier passes are all addressed on this head. The last commit fixes a case I found in my own code where an upgrade to firmware with bit 10 could delete a name the user set before the upgrade. What is left is the call you have flagged four times. #2824 has been assigned to @krushnarout since last October and there is no rename work on that account. @kodjima33 @aaravgarg could you say whether the bounty is free to pick up, and whether the device-persistent scope here is the one you want? The other open item is that nobody has built the firmware except me, so it needs a hardware pass before merge. If it is going to someone else, say so and I will close this. |
kodjima33
left a comment
There was a problem hiding this comment.
Feature (rename Omi, persist on device) - verified app-side only, approve only per policy.
|
Reviewed the app and firmware sides together. The firmware write handler in Two minor, non-blocking notes:
Neither blocks. With the maintainer approval on this head, the remaining step is the merge call once the PR leaves draft. Automated maintainer review on behalf of the Omi maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Main rebuilt the device page on the lib/ui primitives and reduced pages/home/device.dart to an alias, so the rename UI is ported onto it: the dialog becomes an edit sheet, the entry point is the Device Name row in DeviceInfoGroups, and _clearStoredDevice clears the override on forget and unpair. The per-device names move out of preferences.dart, which main keeps at 1500 lines, into services/devices/device_custom_names.dart.
|
Merged main and ported the UI half onto the new device page. The description is rewritten for this head. Renders through the visual audit harness (the production widgets in flutter-tester, no device behind them). The Device Name row is the entry point: The sheet on firmware that stores the name, and on older firmware: After saving, with Reset to default: |
|
Fork CI skips the Dart jobs without |
|
Verdict: solid, well-tested feature — the app and firmware halves line up correctly and I found no blocking issues. Leaving the merge call with a human maintainer since this adds a new device-side BLE protocol surface and the current head has no maintainer approval yet. What I verified in the code:
Security: good call keeping the custom name out of the advertised BLE name — a personal name is not broadcast to nearby phones. GATT permissions match the sibling settings characteristics. Blast radius if wrong: cosmetic (falls back to the advertised name); performance: one extra GATT read per connect, off the critical path. What I'd still want as a reviewer:
USER IMPACT: users can give their Omi a personal name from the device page; on firmware that supports it the name is stored on the wearable itself, so it shows up on any phone that connects to it — on older firmware the name stays on this phone only. Maintainer note: the two earlier approvals predate the latest commits on this head; a fresh pass over the final diff (especially the feature-bit choice above) is all that's left. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |









Fixes #2824.
Adds rename to the Device Name row on the device page. On firmware that supports it the name is stored on the Omi itself, so any phone that connects reads it back, which is what #3111 asked for. On older firmware it stays on the phone.
Firmware (CV1,
omi/firmware/omi). A read/write characteristic on the settings service (19B10015) keeps the name in NVS underomi/device_name. A write is[1, name bytes...]with up to 128 bytes of name, a lone[1]clears it, and a read returns[1]plus the stored bytes. Feature bit 10 advertises it. The characteristic is appended after the charging status CCC, sosettings_service.attrs[6]does not move. The advertised BLE name is left alone, so a personal name is not broadcast to every phone nearby.App. With bit 10, renaming writes the name to the Omi and keeps it locally only once a read back matches; a failed write leaves the old name and shows an error. On connect the stored name replaces this phone's copy, and a device that has never stored one gets the local name pushed up instead of clearing it. The name is kept per device id, shown in the page header, the Device Name row and the pairing list, and removed for that device on Forget Device and unpair.
Ported to the new device page. Main rebuilt the device page on the
lib/uiprimitives, so the UI half moved with it:showOmiEditSheet) with the same keys, byte cap and error handling.DeviceInfoGroups, and the page header shows the custom name._clearStoredDeviceclears the override for Forget Device and the Limitless unpair.pages/home/device.dartis main's alias now, so its two unpair sites are gone._onDeviceConnectedand catches its own errors, so a slow or failed read cannot hold up the recording sync set up after it.preferences.dart, which main keeps at 1500 lines, intoservices/devices/device_custom_names.dart.The wire format and the firmware are unchanged from the approved head.
Verified from
app/:What I could not check: I don't have an Omi, so reading and writing the name needs a pass on a device before this merges. The firmware files are the ones built earlier with the release workflow's Docker image; I have not rebuilt them on this merge.
Product invariants affected
The name characteristic sits on the settings service, and the connect-time name sync runs after audio streaming has started, unawaited, so it cannot delay or abort capture or the recording sync that is set up after it.
UI-Evidence: none -- renders of the row and the sheet are in a comment below, there is no device here to capture on
Failure-Class: none