Page MenuHomePhabricator

[Cashtab] Do not lock UI while token info is loading on NFT screen
ClosedPublic

Authored by bytesofman on Sep 15 2024, 11:07.

Details

Summary

A number of debottleneck opportunities are available to improve the load time of the NFT screen.

This is the easiest one.

We do not actually need the token info to render all the listings. Render the listings when you get them with a spinner for info that comes from token cache.

We can also dramatically improve the speed of getting and caching this token info, but that should be another diff.

Test Plan

npm test, create a wallet and go to the "Listed NFTs" screen on this test site, check the console log, you can see how slow the token info is loading and that it does load (and when it does, we see token info).

https://66e6bed8a1ec4780d1e3866b--cashtab-local-dev.netlify.app/

Diff Detail

Repository
rABC Bitcoin ABC
Branch
nfts-no-token-wait
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30287
Build 60101: Build Diffcashtab-tests · ecash-lib-tests
Build 60100: arc lint + arc unit

Event Timeline

Failed tests logs:

====== CashTab Unit Tests: <Token /> available actions rendered We can send an SLP1 NFT ======
Error: expect(received).toHaveProperty(path, value)

Expected path: "checked"

Expected value: true
Received value: false
    at Object.toHaveProperty (/work/cashtab/src/components/Etokens/__tests__/TokenActions.test.js:829:34)

Each failure log is accessible here:
CashTab Unit Tests: <Token /> available actions rendered We can send an SLP1 NFT

Failed tests logs:

====== CashTab Unit Tests: <Token /> available actions rendered We can send an SLP1 NFT ======
Error: expect(received).toHaveProperty(path, value)

Expected path: "checked"

Expected value: true
Received value: false
    at Object.toHaveProperty (/work/cashtab/src/components/Etokens/__tests__/TokenActions.test.js:829:34)

Each failure log is accessible here:
CashTab Unit Tests: <Token /> available actions rendered We can send an SLP1 NFT

...have not seen this before but appears to be flakiness.

update: confirmed unrelated to this diff, re-run and tests are fine. will keep an eye on this but hasn't repeated yet.

This revision is now accepted and ready to land.Sep 15 2024, 13:55