Skip to content

fix: harden Pro2 update and connection error handling - #949

Open
wabicai wants to merge 5 commits into
onekeyfrom
fix/firmware-v4-ios-file-write-timeout
Open

wabicai wants to merge 5 commits into
onekeyfrom
fix/firmware-v4-ios-file-write-timeout

Conversation

@wabicai

@wabicai wabicai commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Consolidate the fixes previously proposed in fix: distinguish React Native BLE states #946 and fix: normalize React Native BLE GATT setup errors #947 into this PR.
  • Bound React Native V4 firmware file writes to 30 seconds so a stalled iOS BLE response enters the existing reconnect/retry flow.
  • Normalize React Native BLE adapter, stale-bond, GATT setup, and native disconnect errors to existing actionable SDK errors.
  • Report Protocol V2 commands rejected during firmware installation as DeviceBusy instead of leaving the caller stuck without a useful error.
  • Restore bootloader-mode guarding for Protocol V2 methods unless the method explicitly declares bootloader support.
  • Normalize WebUSB claimInterface and transfer failures: disconnected devices report BridgeDeviceDisconnected; enumerated devices with an unavailable interface/endpoint report the new WebUsbDeviceAccessError (903).
  • Bump all workspace packages and internal package references to 1.2.3-alpha.5 for an npm next prerelease.

Requested Jira issues

  • OK-63515: firmware V4 background/write stall recovery.
  • OK-63618: iOS firmware update does not continue after returning from background.
  • OK-63589: React Native BLE state/error classification.
  • OK-63615: stale iOS bond/GATT setup and missing actionable disconnect error after reset.
  • OK-61249: commands attempted during firmware installation now return DeviceBusy.
  • OK-61252: unsupported interactions in Pro2 bootloader mode now return the bootloader-mode prompt.
  • OK-61270: WebUSB removal during communication reports a disconnect error.
  • OK-61333: WebUSB interface/endpoint access failures report a dedicated SDK error.

Scope and compatibility

  • SDK-only changes; no App changes and no dependency upgrades.
  • Public API change is additive: HardwareErrorCode.WebUsbDeviceAccessError = 903. Existing error-code values are unchanged.
  • USB/WebUSB timeout behavior is otherwise unchanged.

Validation

  • Focused Core tests: 62 passed.
  • Focused WebUSB tests: 37 passed.
  • yarn check-versions: all 32 packages are 1.2.3-alpha.5.
  • yarn agent:check --profile commit.
  • yarn agent:check --profile pr (full lint, test, and build).

Remaining physical-device verification

  • Consume 1.2.3-alpha.5 in the App and validate the listed Pro2 flows on iOS.
  • OK-60817: investigate iOS background suspension/termination behavior on a real device. This PR does not claim an App-layer fix for it.

@wabicai wabicai changed the title fix: bound React Native firmware write timeout fix: harden Pro2 update and connection error handling Sep 18, 2026
@wabicai

wabicai commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

npm prerelease result

  • GitHub Actions run: https://github.com/OneKeyHQ/hardware-js-sdk/actions/runs/35317351200
  • Source commit: ee493c3ad41a6bc7fb249fba71d4b9bf8efcced8
  • Version/dist-tag: 1.2.3-alpha.5 / next
  • Result: all 25 publishable packages were independently verified on the public npm registry with both the version and next tag set to 1.2.3-alpha.5.
  • @onekeyfe/hd-core completed npm's asynchronous processing later than the other packages, but is now resolvable; no republish was needed.
  • The workflow intentionally skipped a GitHub Release for this prerelease and did not move latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant