Skip to content

Conversation

gre
Copy link
Contributor

@gre gre commented Aug 8, 2022

📝 Description

Ledger Live is producing a lot of synchronisation and in context of investing how to optimize them, I'm adding in the context of the trigger of a (re-)synchronisation the actual "reason".

Here are the reasons I have put in, it should cover all cases of sync():

  • initial: sync accounts at boot
  • background: regularly synchronizing accounts in background
  • user-click: LLD action on the top bar to re-synchronize
  • view-account: triggered when opening a given account (apparently only happening on LLD)
  • user-pull-to-refresh-one-account: on LLM, user pull to refresh on a given account
  • user-pull-to-refresh: on LLM, user pull to refresh all the accounts
  • transaction-flow-init: for any transactional flow
  • pending-operations: user just did a transaction, we're actively polling for an account update
  • tokens-ignore-list-change: the list of tokens to ignore is changed
  • new-accounts: on LLM, new accounts are getting imported
  • polkadot-bond-loading, tron-power-load: some specific usecases of doing a sync for these coins
  • one-account (fallback of using SyncOneAccountOnMount if the reason wasn't precised, not used yet)

limitation: there is a built-in mechanics that debounce the events to analytics, we don't send a SyncSuccess again after 90s on a same accountId, it may false the statistics a bit.

The first BridgeSync test!

This PR also introduces for the first time some tests on BridgeSync.tsx, component that we saw recently that was lacking of tests. I've been able to actually unit test the analytics usage of that component. I had to polyfill the jest jsdom environement (polkadot: requires to define TextEncoder, solana/celo: indirectly depends on 'uuid' which causes issue on Jest so i had to mock it)

❓ Context

  • Impacted projects: all
  • Linked resource(s): LIVE-3236

✅ Checklist

  • Test coverage
  • Atomic delivery
  • No breaking changes

📸 Demo

 PASS  src/bridge/react/BridgeSync.test.tsx (16.952 s)
  BridgeSync
    ✓ initialized (24 ms)
    ✓ executes a sync at starts with reason=initial (2624 ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        20.07 s

🚀 Expectations to reach

Please make sure you follow these Important Steps.

Pull Requests must pass the CI and be internally validated in order to be merged.

@changeset-bot
Copy link

changeset-bot bot commented Aug 8, 2022

🦋 Changeset detected

Latest commit: f7cc2c8

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

This PR includes changesets to release 2 packages
Name Type
ledger-live-desktop Patch
live-mobile 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

@vercel
Copy link

vercel bot commented Aug 8, 2022

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2022

@gre

Screenshots: ✅

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

@codecov
Copy link

codecov bot commented Aug 9, 2022

Codecov Report

Merging #859 (40143a1) into develop (40143a1) will not change coverage.
The diff coverage is n/a.

❗ Current head 40143a1 differs from pull request most recent head f7cc2c8. Consider uploading reports for the commit f7cc2c8 to get more accurate results

@@           Coverage Diff            @@
##           develop     #859   +/-   ##
========================================
  Coverage    47.50%   47.50%           
========================================
  Files          620      620           
  Lines        27867    27867           
  Branches      7174     7174           
========================================
  Hits         13237    13237           
  Misses       13497    13497           
  Partials      1133     1133           
Flag Coverage Δ
test 47.50% <0.00%> (ø)

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

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

@gre gre force-pushed the support/LIVE-3236 branch from 881c0c2 to 0ac31f5 Compare August 9, 2022 10:52
@gre gre merged commit f66e547 into develop Aug 9, 2022
@gre gre deleted the support/LIVE-3236 branch August 9, 2022 12:57
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 desktop Has changes in LLD mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants