HomePhabricator

[Cashtab] [Alias] Disable alias registrations if alias server is unavailable

Description

[Cashtab] [Alias] Disable alias registrations if alias server is unavailable

Summary:
T3062

Depends on D13503

This diff prevents alias registrations 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.
  • navigate to Alias.js and ensure the registered aliases list is still intact with an exception thrown for getPendingAliases
  • verify in localForage's cashtabCache.aliasCache object is still intact
  • attempt to register a new alias and ensure the Unable to connect to alias server, please try again later error notification is displayed
  • attempt to register an alias already registered in cache and ensure the same alias-server error is displayed
  • 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 and alias registrations are enabled
  • 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/D13504

Details

Provenance
emackAuthored on Mar 30 2023, 03:19
emackPushed on Mar 30 2023, 22:26
Reviewer
Restricted Project
Differential Revision
D13504: [Cashtab] [Alias] Disable alias registrations if alias server is unavailable
Parents
rABC8a17ceb3f28f: [Cashtab] [Alias] Handle bad server response in `getLatestAliases()` on blockā€¦
Branches
Unknown
Tags
Unknown