Skip to content

Conversation

@wabicai
Copy link
Member

@wabicai wabicai commented Sep 5, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved firmware update error handling with clearer “Firmware verification failed” messaging and more accurate error mapping across connection methods.
    • Adjusted navigation redirect handling in the Expo example to prevent premature effect termination.
  • Chores

    • Bumped versions across the suite to 1.1.12-alpha.1.
    • Aligned dependencies to the latest alpha across web, React Native, Electron, and transport packages.
    • No functional changes in packages with metadata-only updates.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 5, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The update introduces a new firmware verification error code and maps it through device command handling and firmware update flow. It tweaks an Expo app navigation effect by removing an early return. It applies a whitespace edit in an EVM signing file. Most other changes bump versions and dependency pins to 1.1.12-alpha.1.

Changes

Cohort / File(s) Summary of changes
Firmware verification error handling
packages/shared/src/HardwareError.ts, packages/core/src/device/DeviceCommands.ts, packages/core/src/api/FirmwareUpdateV3.ts
Added HardwareErrorCode.FirmwareVerificationFailed (820) and message. Mapped device Failure_ProcessError messages containing “verify failed” to this code. Reworked FirmwareUpdateV3 error catch: use Log.error, broaden “unexpected” error codes (incl. BLE and WebDevice errors), rethrow unexpected, wrap others as FirmwareError.
Expo navigation effect flow
packages/connect-examples/expo-example/App.tsx
Removed early return after handling redirectPath inside useEffect; spa_redirect_url branch still returns early.
Formatting only
packages/core/src/api/evm/latest/signTransaction.ts
Removed a blank line; no behavioral changes.
Version and dependency bumps
packages/*/*/package.jsonpackages/connect-examples/electron-example/package.json, packages/connect-examples/expo-example/package.json, packages/connect-examples/expo-playground/package.json, packages/connect-examples/shared-constants/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 (and its devDependency), packages/hd-transport/package.json, packages/hd-web-sdk/package.json, packages/shared/package.json
Bumped package versions to 1.1.12-alpha.1 and aligned internal @onekeyfe dependencies to 1.1.12-alpha.1. No code changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App as App/Core API
  participant Dev as Device
  participant Cmd as DeviceCommands
  participant FW as FirmwareUpdateV3
  participant Err as HardwareError

  App->>FW: triggerFirmwareUpdateEmmc()
  FW->>Dev: Start firmware update
  Dev-->>FW: Failure (ProcessError, message includes "verify failed")
  FW->>Cmd: _filterCommonTypes(Failure)
  Cmd-->>FW: Map to Err.FirmwareVerificationFailed
  FW->>FW: Catch error
  alt Error code in unexpected list (incl. BLE/WebDevice)
    FW-->>App: Rethrow original error
  else Other errors
    FW-->>App: Throw TypedError(FirmwareError, message)
  end
Loading
sequenceDiagram
  autonumber
  participant Nav as NavigationContent (useEffect)
  participant Hist as History

  Nav->>Nav: Check redirectPath
  alt redirectPath exists
    Nav->>Hist: replaceState(...)
    Nav->>Nav: cleanup redirect params
    Note right of Nav: Effect continues (no early return)
  else spa_redirect_url exists
    Nav->>Hist: replaceState(...)
    Note right of Nav: Early return unchanged
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes


📜 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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear 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 f774d34 and 96fefa9.

📒 Files selected for processing (21)
  • packages/connect-examples/electron-example/package.json (2 hunks)
  • packages/connect-examples/expo-example/App.tsx (0 hunks)
  • packages/connect-examples/expo-example/package.json (2 hunks)
  • packages/connect-examples/expo-playground/package.json (2 hunks)
  • packages/connect-examples/shared-constants/package.json (1 hunks)
  • packages/core/package.json (2 hunks)
  • packages/core/src/api/FirmwareUpdateV3.ts (2 hunks)
  • packages/core/src/api/evm/latest/signTransaction.ts (0 hunks)
  • packages/core/src/device/DeviceCommands.ts (1 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 (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/boot-verify

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or Summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@revan-zhang
Copy link
Contributor

revan-zhang commented Sep 5, 2025

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

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@wabicai wabicai enabled auto-merge (squash) September 5, 2025 08:34
@wabicai wabicai merged commit 0f0d469 into onekey Sep 5, 2025
9 of 10 checks passed
@wabicai wabicai deleted the fix/boot-verify branch September 5, 2025 08:36
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