Skip to content

username change: no invalid chars should be allowed as input, improve error message #1682

Description

@cygnusb
  • Your Rocket.Chat Experimental app version: 4.3.1.13914
  • Your Rocket.Chat server version: 2.3.2
  • Device (or Simulator) you're running with: iOS on iPhone 13.3

When changing the profile settings, it is possible to enter invalid chars in the username field.

The app complains with something like: "error occured on saving profile"

Two things should be changed here:

  • entering invalid chars in the username field should be suppressed on app side
  • reasonable error message should be given to the user, at least that there is an issue in the username field

On server side it API complains with:

Feb 08 09:50:52 XXX rocketchat[14023]: server.js:204 Meteor ➔ method saveUserProfile -> userId: pT5QeM5Cc8nzWeXew, arguments: [{},{"XXXX":"XXXX"}]
Feb 08 09:50:52 XXX rocketchat[14023]: server.js:204 Meteor ➔ method setUsername -> userId: pT5QeM5Cc8nzWeXew, arguments: ["cygnus b"]
Feb 08 09:50:52 XXX rocketchat[14023]: server.js:204 API ➔ debug post users.updateOwnBasicInfo threw an error: Error: cygnus b is not a valid username, use only letters, numbers, dots, hyphens and underscores [username-invalid]```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions