Page MenuHomePhabricator

[Cashtab][Alias] Deprecate alias history refresh in handleUpdateWallet
ClosedPublic

Authored by emack on Jul 1 2023, 15:33.

Details

Summary

T3216

Alias caching is now being incrementally deprecated in cashtab and alias data will be retrieved directly via api endpoints. Therefore removing the alias caching refresh trigger upon wallet load.

Test Plan

npm test
npm start
enable the aliasSettings.aliasEnabled flag in Ticker.js (will be moved in subsequent diff)
open dev conole and observe no logs relevant to getLatestAliases() upon app load
disable the aliasFlag, reload cashtab and ensure no logs relevant to getLatestAliases() upon app load

Diff Detail

Repository
rABC Bitcoin ABC
Branch
handleUpdateWallet
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24313
Build 48236: Build Diffcashtab-tests
Build 48235: arc lint + arc unit

Event Timeline

emack requested review of this revision.Jul 1 2023, 15:33
bytesofman requested changes to this revision.Jul 1 2023, 21:30
bytesofman added inline comments.
cashtab/src/hooks/__tests__/useWallet.test.js
31 ↗(On Diff #41160)

nice test that we should have in general

i'm not sure why isValidStoredWallet does not also check for these keys.

red flag that we need to write a custom validation function to use in an unrelated test...we should just have a validation function.

My guess is that isValidStoredWallet has been around longer than the latest wallet shape we are using.

  1. In a separate diff, update isValidStoredWallet to check for these keys and deal with whatever test mocks might need to be updated to support this
  2. Update this test to use that function
This revision now requires changes to proceed.Jul 1 2023, 21:30
cashtab/src/hooks/__tests__/useWallet.test.js
31 ↗(On Diff #41160)

Updated unit test to use the updated isValidStoredWallet validation function from D14190

cashtab/src/hooks/useWallet.js
1630

is this needed for the unit test to work?

emack marked an inline comment as done.Jul 2 2023, 16:14
emack added inline comments.
cashtab/src/hooks/useWallet.js
1630

Yes, otherwise it is not exposed to 'result.current'

This revision is now accepted and ready to land.Jul 2 2023, 21:43