-
Notifications
You must be signed in to change notification settings - Fork 924
WebHostLib: Properly format IDs in API responses #4944
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
base: main
Are you sure you want to change the base?
Conversation
…elf arg, and then use the formatter for the user session endpoints
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.
I'm not really sure why they were instance methods in the first place, but this all looks correct. I'm not really sure why our api endpoints were all returning the encoded versions instead of the url safe decoded since those are unusable without the client requesting the information doing the same decoding the webhost already has to do in other places, so definitely support returning all of them as decoded.
Co-authored-by: Aaron Wagener <[email protected]>
It's rather simple, really. I looked at the implementation of other Convertors. |
I can pull those functions out to standalone helpers if you really want, but i really hope their code isn't depending on |
If we really want to follow that pattern then we're better off instantiating it |
updated with new helpers to be used by other calls and reverting Converter class to BaseConverter style |
What is this fixing or adding?
update the id formatter to use staticmethods to not fake the unused self arg, and then use the formatter for the user session endpoints
found testing #4887
the user session responses have unusable ids that cause the id parser on webhost to error out with a
ValueError: bytes is not a 16-char string
this also refactors the formatter class to use the staticmethod decorator like it's already being used
How was this tested?
and manually pinging the different apis and using returned ids in more api calls in browser
If this makes graphical changes, please attach screenshots.