Page MenuHomePhabricator

[Cashtab] [Alias] Handle bad server response in `getLatestAliases()` on block routine
ClosedPublic

Authored by emack on Mar 30 2023, 02:35.

Details

Summary

T3061

This diff ensures the existing aliasCache object in localforage does not get wiped out in the event of the alias-server being down.

Users can still view their registered aliases and send XEC to aliases in their existing cache.

Test Plan
  • change currency.aliasSettings.aliasServerBaseUrl in ticker.js to an incorrect url
  • enable alias in ticker.js
  • npm start
  • note the getAliasServerState exception and ensure the existing aliases in cache have not been wiped out. Verify there are no getAliasServerHistory exceptions thrown because the code should not have reached that far
  • navigate to Alias.js and ensure the registered aliases list is still intact
  • verify in localForage's cashtabCache.aliasCache object is still intact
  • navigate to Send.js and SendToken.js and ensure aliases in cache are still resolving to their corresponding addresses
  • wait for a new block to be found and ensure this does not wipe out the aliases in cache either
  • revert currency.aliasSettings.aliasServerBaseUrl to the original url and ensure no issues with onchain alias count polling
  • disable alias in ticker.js and ensure no regression to existing functions

Diff Detail

Repository
rABC Bitcoin ABC
Branch
handleBadRespGetLatestAliases
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22819
Build 45258: Build Diffcashtab-tests
Build 45257: arc lint + arc unit