HomePhabricator

[Cashtab] [Alias] Enforce alphanumeric inputs

Description

[Cashtab] [Alias] Enforce alphanumeric inputs

Summary:
T2551

As per feedback from beta testing, the initial release will be limited to lowercase alphanumeric inputs.

Test Plan:

  • enable Alias in ticker.js
  • npm start
  • navigate to Alias.js and ensure lowercase a-z and 0-9 inputs within 21 bytes are all accepted and successfully registered
  • ensure zero-width spaces, special characters, non-english characters and emojis are invalid.

*new tests*

  • open a wallet that has registered non-alphanumeric aliases prior to this diff
  • observe console log message Non-alphanumeric alias detected in cache, resetting aliasCache and a full alias tx history retrival is triggered
  • navigate to Alias.js and ensure the registered list only shows alphanumeric aliases
  • register a new alias and ensure only partial alias tx history retrieval is triggered
  • inspect aliasCache in localforage and ensure no non-alphanumeric aliases in alias array. Also note the size of paymentTxHistory being much larger than aliases due to the invalidation of previously valid non-alphanumeric aliases.

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D13278

Details

Provenance
emackAuthored on Mar 10 2023, 23:21
emackPushed on Mar 13 2023, 00:08
Reviewer
Restricted Project
Differential Revision
D13278: [Cashtab] [Alias] Enforce alphanumeric inputs
Parents
rABC5b6fbec012da: [tg bot] Parse OP_RETURN msgs
Branches
Unknown
Tags
Unknown