-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYNPY-1186] When a username is a number, getUserProfile cannot retrieve the user #1014
[SYNPY-1186] When a username is a number, getUserProfile cannot retrieve the user #1014
Conversation
I like the approach you are taking on this - While looking for areas/dependent functions let's take the time to update the parameter section of those function(s) docstrings to be clear that typing of the data they're passing in matters and what we'll do with a string vs int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 Let's hold on the deprecation warning because we don't want it popping up every time someone uses the functions that leverages getUserProfile.
We will need to create separate tickets for the deprecation and also create platform tickets for not allowing integer usernames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent - here's some feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 LGTM!
Problem:
When a user calls the
getUserProfile
method with a username that is a number, the appropriateUserProfile
is not retrieved. This essentially boils down to the fact that we currently allow people to passuserName
s andownerId
s togetUserProfile
, and that people are allowed to create usernames on Synapse that are just a string of numbers.Solution:
Split
getUserProfile
into two separate functions. One that acceptsuserName
as a string only, and one that only will accept anownerId
in the form of an integer.A complication of this solution is that
getUserProfile
is used in a number of places, some of which also allowuserName
s orownerId
s. This refactoring and the eventual deprecation ofgetUserProfile
will need to be done in a future PR.