Skip to content

Conversation

@ByteZhang1024
Copy link
Contributor

@ByteZhang1024 ByteZhang1024 commented Dec 1, 2025

Summary by CodeRabbit

Release Notes

  • Chores

    • Released version 1.1.19 (stable release from alpha pre-release).
    • Updated all package dependencies to version 1.1.19.
  • Bug Fixes

    • Enhanced error handling to include firmware type context for better device compatibility diagnostics.
    • Improved device method validation with structured error messages.

✏️ Tip: You can customize this high-level summary in your review settings.

@revan-zhang
Copy link
Contributor

revan-zhang commented Dec 1, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Release version promotion from 1.1.19-alpha.8 to 1.1.19 across all packages. Updates package versions, dependencies, and refactors error handling to use new structured error factory functions with firmware type context.

Changes

Cohort / File(s) Change Summary
Package version and dependency bumps
packages/connect-examples/electron-example/package.json, packages/connect-examples/expo-example/package.json, packages/connect-examples/expo-playground/package.json, packages/core/package.json, packages/hd-ble-sdk/package.json, packages/hd-common-connect-sdk/package.json, packages/hd-transport-electron/package.json, packages/hd-transport-emulator/package.json, packages/hd-transport-http/package.json, packages/hd-transport-lowlevel/package.json, packages/hd-transport-react-native/package.json, packages/hd-transport-web-device/package.json, packages/hd-transport/package.json, packages/hd-web-sdk/package.json, packages/shared/package.json
Version bumped to 1.1.19; all internal dependencies updated from 1.1.19-alpha.8 to 1.1.19
Error factory refactoring
packages/shared/src/HardwareError.ts
New function createDeviceNotSupportMethodError added. createNeedUpgradeFirmwareHardwareError and createNewFirmwareUnReleaseHardwareError signatures changed to accept structured object with currentVersion, requireVersion, methodName, and firmwareType. Added firmware-type guard for Bitcoin-only devices.
Error factory adoption
packages/core/src/api/BaseMethod.ts, packages/core/src/api/tron/TronSignMessage.ts, packages/core/src/core/index.ts
Replaced ERRORS.TypedError calls with new error factory functions. Updated error calls to pass structured objects with firmware type context via getFirmwareType().
Error handling and signature updates
packages/core/src/api/allnetwork/AllNetworkGetAddressBase.ts
Added getFirmwareType import. Updated error construction for firmware checks and device support validation. Broadened error detection to treat Failure_UnknownMessage as skippable.
Batch public key function refactor
packages/core/src/api/helpers/batchGetPublickeys.ts
Added ecdsaCurveName and coinType parameters to function signature. Added path-length and coin-type validation. Introduced device-type-based batch sizing. Updated error handling to use new factory functions and structured error objects. Changed imports to type-only where applicable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

  • Package updates — 15 files with identical version bumps (homogeneous, ~1 min each across the group)
  • Shared error module — New factory functions with conditional logic; requires validation of parameter object changes and firmware-type guard logic
  • API file migrations — Five files adopting new error factories; verify consistent firmware-type passing via getFirmwareType()
  • batchGetPublickeys refactor — Most complex change: new function parameters, validation logic, batch sizing, and error handling; requires careful verification of coin-type enforcement and path validation

Extra attention needed:

  • Verify that all calls to createNeedUpgradeFirmwareHardwareError and createNewFirmwareUnReleaseHardwareError pass the new object format consistently
  • Check batchGetPublickeys signature adoption across all call sites
  • Confirm firmware-type guard in HardwareError.ts doesn't unintentionally suppress valid errors
  • Validate coin-type and path-length checks in batch function logic
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/notSupportMethod

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3f2601d and 1a58e97.

📒 Files selected for processing (21)
  • packages/connect-examples/electron-example/package.json (2 hunks)
  • packages/connect-examples/expo-example/package.json (2 hunks)
  • packages/connect-examples/expo-playground/package.json (2 hunks)
  • packages/core/package.json (2 hunks)
  • packages/core/src/api/BaseMethod.ts (3 hunks)
  • packages/core/src/api/allnetwork/AllNetworkGetAddressBase.ts (4 hunks)
  • packages/core/src/api/helpers/batchGetPublickeys.ts (3 hunks)
  • packages/core/src/api/tron/TronSignMessage.ts (2 hunks)
  • packages/core/src/core/index.ts (3 hunks)
  • packages/hd-ble-sdk/package.json (2 hunks)
  • packages/hd-common-connect-sdk/package.json (2 hunks)
  • packages/hd-transport-electron/package.json (2 hunks)
  • packages/hd-transport-emulator/package.json (2 hunks)
  • packages/hd-transport-http/package.json (2 hunks)
  • packages/hd-transport-lowlevel/package.json (2 hunks)
  • packages/hd-transport-react-native/package.json (2 hunks)
  • packages/hd-transport-web-device/package.json (2 hunks)
  • packages/hd-transport/package.json (1 hunks)
  • packages/hd-web-sdk/package.json (2 hunks)
  • packages/shared/package.json (1 hunks)
  • packages/shared/src/HardwareError.ts (4 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@ByteZhang1024 ByteZhang1024 enabled auto-merge (squash) December 1, 2025 13:00
@ByteZhang1024 ByteZhang1024 merged commit f2d2ffc into onekey Dec 1, 2025
9 of 10 checks passed
@ByteZhang1024 ByteZhang1024 deleted the fix/notSupportMethod branch December 1, 2025 13:00
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.

4 participants