matrix-org / matrix-org/matrix-ios-sdk
`isUserNameInUse` doesn't work if registration is turned off
Nobody has claimed this yet.
- Dominant language
- Objective-C
- Stars
- 484
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
I'm working on a bridge (that, for now, just works as a basic bot) where the user has to enter a matrix ID that the bot will relay messages to. I'd like to be able to check that the user ID they've entered is actually a valid, existing ID, but if registration is turned off on that server, isUserNameInUse will return false, even if that username is in use.
It looks like isUserNameInUse just attempts registration with that username and looks for kMXErrCodeStringUserInUse. But if registration is turned off then the attempted registration throws a "Registration has been disabled" error and isUserNameInUsereturns false.
It would be nice if there were a way to check if a username exists, in my case to help make sure the user has things set up correctly, but if there isn't a good way to that it would be good to at least document that behavior in the header file. I realize that isUserNameInUse was probably intended for a registration flow, but it would definitely be useful outside of that too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read MatrixSDK/MXRestClient.m around the isUserNameInUse implementation and its linked registration path first, then inspect the related header declaration. Determine whether the API can distinguish an existing username when registration is disabled; done means either a supported check with coverage for that server state or clear header documentation of the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- api, authentication
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100