Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/FAT-588 Improve LLM background device communication #1871

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

juan-cortes
Copy link
Contributor

📝 Description

This PR introduces a fix on the runners that allows the internal errors that can occur while installing an app to bubble up and reach the surface device action instead of being treated as false completion positives.

It also introduces a forceful disconnection timeout when we try to close the connection with a device on the BleTransport, preventing endless awaits if the JavaScript thread is paused in the middle of an exchange. This unlocks cases where we were left in a soft brick state where we couldn't communicate with the device anymore until we rebooted or restarted LLM.

Lastly, it enables (like on BIM) background BLE communication capabilities, allowing us to communicate with the device over BLE for some time making the UX a bit better than abruptly breaking.

❓ Context

  • Impacted projects: ledger-live-mobile, react-native-hw-transport-ble, ledger-live-common
  • Linked resource(s): https://ledgerhq.atlassian.net/browse/FAT-588

✅ Checklist

  • Test coverage
  • Atomic delivery
  • No breaking changes

🚀 Expectations to reach

We shouldn't get stuck in a flow regardless of a failure to communicate or complete the flow because of a background or disconnect.

@vercel
Copy link

vercel bot commented Nov 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
live-common-tools ✅ Ready (Inspect) Visit Preview Nov 29, 2022 at 11:30AM (UTC)
3 Ignored Deployments
Name Status Preview Updated
ledger-live-github-bot ⬜️ Ignored (Inspect) Nov 29, 2022 at 11:30AM (UTC)
native-ui-storybook ⬜️ Ignored (Inspect) Nov 29, 2022 at 11:30AM (UTC)
react-ui-storybook ⬜️ Ignored (Inspect) Nov 29, 2022 at 11:30AM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2022

🦋 Changeset detected

Latest commit: 3718f98

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@ledgerhq/live-common Patch
@ledgerhq/react-native-hw-transport-ble Patch
live-mobile Patch
@ledgerhq/live-cli Patch
ledger-live-desktop Patch
live-common-tools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs mobile Has changes in LLM labels Nov 18, 2022
@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Base: 0.00% // Head: 42.85% // Increases project coverage by +42.85% 🎉

Coverage data is based on head (cadd064) compared to base (257900e).
Patch coverage: 0.00% of modified lines in pull request are covered.

❗ Current head cadd064 differs from pull request most recent head 3718f98. Consider uploading reports for the commit 3718f98 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #1871       +/-   ##
============================================
+ Coverage         0   42.85%   +42.85%     
============================================
  Files            0      624      +624     
  Lines            0    25895    +25895     
  Branches         0     7159     +7159     
============================================
+ Hits             0    11097    +11097     
- Misses           0    13640    +13640     
- Partials         0     1158     +1158     
Flag Coverage Δ
test 42.85% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
libs/ledger-live-common/src/apps/runner.ts 50.00% <0.00%> (ø)
libs/ledger-live-common/src/bridge/impl.ts 71.42% <0.00%> (ø)
...common/src/families/ethereum/prepareTransaction.ts 65.21% <0.00%> (ø)
...mmon/src/families/bitcoin/getAccountNetworkInfo.ts 31.42% <0.00%> (ø)
libs/ledger-live-common/src/mock/helpers.ts 84.61% <0.00%> (ø)
...er-live-common/src/families/polkadot/validators.ts 100.00% <0.00%> (ø)
...er-live-common/src/families/stellar/transaction.ts 23.07% <0.00%> (ø)
libs/ledger-live-common/src/exchange/swap/index.ts 92.45% <0.00%> (ø)
libs/ledger-live-common/src/generated/mock.ts 100.00% <0.00%> (ø)
...er-live-common/src/api/explorerConfig/overrides.ts 97.01% <0.00%> (ø)
... and 615 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2022

@juan-cortes

Screenshots: ✅

There are no changes in the screenshots for this PR. If this is expected, you are good to go.

Copy link
Contributor

@alexandremgo alexandremgo left a comment

Choose a reason for hiding this comment

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

🔥 - just maybe a comment on the delay to explain why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants