Page MenuHomePhabricator

[Cashtab] Better error handling for rendering txs
ClosedPublic

Authored by bytesofman on Mar 24 2024, 12:58.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC1d37abee4859: [Cashtab] Better error handling for rendering txs
Summary

Now that we are in in-node chronik, tokenEntries will always be an array. However, some users got this error when Cashtab migrated to in-node chronik, since parsedTxHistory loaded from storage does not have tokenEntries (coming from nng chronik).

Add better validation to handle this migration case.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested changes to this revision.Mar 24 2024, 13:27
emack added a subscriber: emack.
emack added inline comments.
cashtab/src/components/Home/Tx.js
586–587 ↗(On Diff #46416)

This type check is redundant because Array.isArray() on an undefined data.tokenEntries will correctly return false.

This revision now requires changes to proceed.Mar 24 2024, 13:27

remove redundant type check

This revision is now accepted and ready to land.Mar 24 2024, 23:28