fix(hci): prevent duplicate raw connection fallback - #22
Conversation
|
CI note: the failing Windows jobs are a baseline runner/toolchain issue, not caused by this patch. They fail during npm ci because windows-latest now exposes Visual Studio 18 to node-gyp 10. The isolated workflow fix is #24; Linux/arm64, Linux/x64, Android, macOS, lint, and commit validation for this PR pass. |
94c78c4 to
2e607ba
Compare
|
CI is green after rebasing this branch onto #24: 27 build/test checks passed, including Node 18/20 on Windows and win32 x86/x64 prebuilds; only the expected release jobs were skipped. The PR comparison remains limited to the three native socket files. Merge order: #24 first, then retarget #22 to |
2e607ba to
c38b39a
Compare
|
PR #24 is merged. This branch has now been rebased onto the resulting The comparison remains limited to the three native socket files. All current check runs are green, with no failures or pending jobs; release jobs were skipped as expected. The PR remains draft pending the documented Linux/BLE hardware validation. |
What
connect()nonblocking soEINPROGRESSproves the kernel accepted the controller requestLE Create Connectionfallback when the accepted kernel attempt later failsWhy
The previous boolean path treated every failed blocking L2CAP
connect()as “not handled.” When the controller had already completed an attempt with an error such as0x3e,Write()then sent the original raw HCI command and launched a second controller attempt for one logical connection.This matches the duplicate kernel/process command sequence being tracked in stoprocent/noble#97, noble#98, and noble#102.
Validation
Controlled Linux/arm64 kernel regression test using two BlueZ
btvirtLE controllers andbtmon:write()containingLE Create Connection.connect()to fail after the controller attempt had started.LE Create Connectioncommands for onewrite()e33de06(merged baseline)c38b39a(this PR)Additional checks:
node-gypThe repository's current
test.jslogsTypeError: BluetoothHCISocket is not a constructoron both the merged baseline and this PR, but exits successfully because it catches every construction error. It is therefore not meaningful runtime coverage for this patch; the direct native-addon/VHCI test above exercised the affected code path.Fixes #21