status-im / ens-usernames

DApp to register usernames for Status Network
MIT License
19 stars 11 forks source link

ENS DApp - "This name is not allowed" bug occuring for no reason #93

Open naghdy opened 5 years ago

naghdy commented 5 years ago

Getting this bug below even when the username length is fine. Also the error is confusing for users because it doesn't explain what is going on.

img_5514

rachelhamlin commented 5 years ago

This one is now on the browser team's pivotal board for this iteration.

flexsurfer commented 5 years ago

can't reproduce image

flexsurfer commented 5 years ago

so there are the conditions for this error

  if (value !== val.trim()) return DomainNameStatus.TosViolation;
  if (value.length < 4) return DomainNameStatus.TosViolation;
  if (addressLikeUsername(value)) return DomainNameStatus.TosViolation;

but i can't reproduce it with spaces, only one way i found 1) enter the wrong name, less than 4 chars 2) add space before a name, and make a name more than 4 chars 3) press done 4) nothing happens, same error on the screen the reason name with spaces is not handled

flexsurfer commented 5 years ago

Do we want to change the text for this error?

rachelhamlin commented 5 years ago

@flexsurfer could we tailor the error messages to the error?

Please enter a name more than 4 characters in length.

Only letters and numbers are allowed. Please try another name.

hesterbruikman commented 5 years ago

Related issue on naming requirements: https://github.com/status-im/status-react/issues/7886

Also, I was creating this new issue, when I came accross this one. I think it might be the same:

Text field in ENS DApp shows lower case when (invalid) upper case is entered

Problem

When searching for an available name in the ENS DApp, the DApp shows an unexpected message: "This name is not allowed by the terms & conditions. Please try another."

This message occurs when a character (typically the first character) is entered as a upper case. character. (Starting with uppercase is a default on native keyboards and therefore this issue is most likely to occur on the first character, but can occur with use of any upper case character.)

The input field displays all characters as lower case, also when they are entered as upper case. Meanwhile the upper case entry still triggers the validation as upper case is not allowed.

The issue occurs on (not necessarily limited to)

Expected behavior

The app shows upper case when upper case is entered Nice to have: The app brings up a native keyboard that only provides lower case (Android, already the case on iOS)

Current behavior

The app displays lower case while upper case is entered. The app brings up the native keyboard with default set to for the first character to be upper case (Android, not the case on iOS)

Implementation

Known steps towards feature implementation. What needs further specifying and investigating.

Acceptance Criteria

DApp follows expected behavior on both iOS and Android

cc @naghdy do you recall if this issue mostly occurred using iOS or Android?

rachelhamlin commented 5 years ago

Ah, interesting. Good find @hesterbruikman. This is something we will need to account for in the new registration flow in Status @jeluard @asemiankevich.

jeluard commented 5 years ago

Thanks! I'll make sure this case is addressed in the native registration.