HomePhabricator

[Cashtab] Parse tx history async to resolve UI lock issue on homescreen

Description

[Cashtab] Parse tx history async to resolve UI lock issue on homescreen

Summary:
Cashtab has a bug in tx parsing that causes the UI to lock while tx history is rendered. It's especially noticeable on wallets with Agora txs in history.
'
Tx parsing should be done async. The parsed tx should then be passed to the Tx component for rendering.

We have instead been using the Tx component to parse and render txs.

This diff refactors Cashtab tx parsing so that all parsing is handled by the parseTx function, which is called async on each tx. When the history is ready, it is passed to the Tx component for rendering.

The size of the refactor makes this a difficult review. However, now that parsedTx is strongly typed, the logic changes can be deduced from the new type definitions. We preserve all of the rendering tests, which are updated for some differences in parsing (for example, we now parse each tokenEntry insteead of just the first).

Test Plan:
npm test

This diff is deployed at the test site https://cashtab-local-dev.netlify.app/#/

Can confirm there that load times are significantly improved for wallets with Agora txs in history.

This diff also fixes the issue of the "menu expand animation goes slow"

night and day performance difference

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

Differential Revision: https://reviews.bitcoinabc.org/D17340

Details

Provenance
bytesofmanAuthored on Thu, Dec 12, 15:02
bytesofmanPushed on Tue, Dec 17, 14:55
Reviewer
Restricted Project
Differential Revision
D17340: [Cashtab] Parse tx history async to resolve UI lock issue on homescreen
Parents
rABCbdfd881df17c: [chronik] add electrum method blockchain.transaction.get_height
Branches
Unknown
Tags
Unknown