Repository navigation
Conversation
Connections are keyed by device id and teardown is scoped to the device being connected, disconnected or forgotten, so connecting a second device no longer drops the first. forgetDevice previously tore down whichever connection was open rather than the one it was asked to forget.
|
Test output for the behaviour claims above, since there is no UI to screenshot here: Correcting my own line above: I first wrote that two of these fail on current main, which is not something I ran. They cannot run against main unchanged, because the service API differs there (no |
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
… recording device stop() left every connection open, and the speech profile page resolved its codec through the persisted device id while the page itself records the provider's device; those differ once more than one device exists.
|
Both fixed in 61655d6. stop() now tears down every connection instead of leaving them open, and the speech profile page resolves its codec through the device it is actually recording from rather than the persisted id. Six tests now, and I retitled this: I am not claiming #2954, since you said in April OmiGlass records audio already and the feature was not needed. What is left is the forgetDevice ownership bug and its guard. |
|
Verified the bug this fixes: on main, Per file:
Scope check: this is the connection-ownership bug and its guard, not multi-device capture — the description explicitly does not claim #2954 and capture still records one device. The registry is the minimal foundation that makes the guard testable, so I don't think a split is warranted. CI note: no check runs are configured on this head, so the locally posted Nice work @singhharsh1708 — the bug writeup in the description is precise, the follow-up comment correcting which tests fail on main is honest, and the tests target exactly the regression being fixed. Positive signal from me. Since every device type's connection lifecycle flows through Automated maintainer-review feedback on behalf of the Omi maintainers. by AI on behalf of David — human maintainer sign-off requested for the two connection-lifecycle behavior changes noted above before merge. |
|
On the forced-reconnect point, I don't think that one holds. |
kodjima33
left a comment
There was a problem hiding this comment.
Mobile bug fix (device-id-scoped connection teardown), confidence ~4/5 (clear root cause, fix(app) title, scoped diff, regression tests) but zero CI checks have actually run on this fork PR (statusCheckRollup empty) -- holding at approve until CI executes rather than merging on self-reported test output alone.
kodjima33
left a comment
There was a problem hiding this comment.
Bug fix: forgetDevice/disconnect teardown now scoped per-device-id instead of a single shared connection field — real defect once a second device exists, well-scoped diff (271 lines), 5 new regression tests. Confidence 5/5, merges under mobile bug-fix confidence gate.
forgetDevice(deviceId)disconnects and disposes whichever connection happens to be open rather than the one it was asked to forget, becauseDeviceServicekeeps a single connection field and never checks the id against it. Today that is invisible, since there is only ever one connection. It stops being invisible the moment a second device exists.Fixing it properly means the service has to know which connection belongs to which device, so connections are keyed by device id and teardown is scoped to the device being connected, disconnected, forgotten or stopped.
stop()now tears down every connection instead of leaving them open, which the single field did too.ensureConnectionkeeps its signature and all 63 callers already pass a device id, so they did not move. The two places that read the old single-connection field are migrated rather than aliased:_bleDisconnectDevicealready had the device it was disconnecting, and the speech profile page resolves the codec through the device the page is recording from. Stored-device lookup readsbtDevicesinstead of the singlebtDevice, so a device other than the last paired one can still be found on a background reconnect.I am not claiming #2954 with this. You said there in April that OmiGlass records audio already and the feature was not needed, so this is the connection-ownership bug and its guard, nothing more. Capture still records one device.
Verified by running, from
app/:The six tests drive the registry through an injectable connection builder, the same dependency-injection shape
DeviceProvideralready uses for its loaders: a second device connecting leaves the first connected, an already connected device is reused, and disconnecting, forgetting or stopping tears down only what it should. I have no omi device here, so none of this ran over real BLE.Failure-Class: none