Page MenuHomePhabricator

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

Authored by bytesofman on Thu, Dec 12, 15:03.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Cashtab tx parsing was moved to the screen to better support render testing. When parsing was simpler, this was not an issue. Now that we have more app actions and token actions to parse, this needs to be handled async so we do not lock the screen while these calculations are performed.

Test Plan

npm test

Event Timeline

Tail of the build log:

Run `npm audit` for details.

> ecash-lib@1.1.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Installing ecash-agora dependencies...
/work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests

added 364 packages, and audited 367 packages in 2s

60 packages are looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.2.0 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1489 packages, and audited 3335 packages in 24s

323 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (2 low, 4 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> cashtab@3.2.12 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

TS2739: Type '{ xecTxType: XecTxType.Received; satoshisSent: number; stackArray: string[]; recipients: string[]; }' is missing the following properties from type 'ParsedTx': parsedTokenEntries, appActions
    275 |                 tokenFailedParsings: [],
    276 |                 tokenStatus: 'TOKEN_STATUS_NORMAL',
  > 277 |                 parsed: {
        |                 ^^^^^^
    278 |                     xecTxType: XecTxType.Received,
    279 |                     satoshisSent: 546,
    280 |                     stackArray: [


Build cashtab-tests failed with exit code 1