[Cashtab] [Alias] Handle bad server response in getLatestAliases() on block routine
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
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D13503