Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

LIVE-545 Add Invalid channel to the list of disconnected errors #857

Conversation

grsoares21
Copy link

A common error that might happen when a device is abruptly disconnected from USB during an exchange is the "Invalid channel" error.

Defined at android/src/main/java/com/ledgerwallet/hid/LedgerHelper.java at lines 82, 85, 54 and 57.

This PR adds this error to a list of errors that get caught and mapped to a DisconnectedDevice type of error. This provides a cleaner wording for the user explaining that the device was disconnected and the user should retry the operation. Without it, the error that is displayed to the user states only "Invalid channel" which doesn't mean much and isn't even translated.

PS.: For now, a manual mapping was added in LLM in LedgerHQ/ledger-live-mobile#2432 . After this is merged and all upgrades are done to LLC and then LLM, that manual mapping can be removed.

@grsoares21 grsoares21 requested a review from a team as a code owner May 9, 2022 13:19
@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #857 (ea8c5bd) into master (ae240fb) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #857   +/-   ##
=======================================
  Coverage   43.56%   43.56%           
=======================================
  Files          81       81           
  Lines        4823     4823           
  Branches      791      770   -21     
=======================================
  Hits         2101     2101           
- Misses       2705     2708    +3     
+ Partials       17       14    -3     
Impacted Files Coverage Δ
packages/react-native-hid/src/index.ts 0.00% <ø> (ø)
packages/hw-transport-http/src/HttpTransport.ts 0.00% <0.00%> (ø)
...ckages/hw-transport-http/src/WebSocketTransport.ts 0.00% <0.00%> (ø)
...s/react-native-hw-transport-ble/src/awaitsBleOn.ts 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae240fb...ea8c5bd. Read the comment docs.

Copy link
Contributor

@juan-cortes juan-cortes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ghost
Copy link

ghost commented May 23, 2022

Hi @grsoares21 do you want to migrate this work to the monorepo, or should we close it?

@grsoares21
Copy link
Author

@haammar-ledger I'm closing this. I've already migrated it to the mono repo in the same PR as the firmware update.

@grsoares21 grsoares21 closed this May 23, 2022
@grsoares21 grsoares21 deleted the feat/LIVE-545-add-invalid-channel-to-disconnected-errors branch May 23, 2022 16:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants