Closed louismeunier closed 3 years ago
After looking into a bit more, this MAY be related to #266, but I'm really not sure.
Hey Louis, thanks for the detailed report. What you described is actually expected, but it sure may be confusing. We have two kinds of identity: a person (= WCA results profile) and a user (=user account). For historical reasons not every person has an associated user account. Users may connect their account to the corresponding WCA profile. Every profile with an avatar does have a user account, because it's either connected to a real user account or to so called dummy user account (which actually stores the avatar). This is mostly noticeable for old WCA profiles, as now most competitions use the WCA registration platform and users are more likely to connect their account to their profile. Hopefully we will eventually have this discrepancy removed.
If you're looking for a way to search/retrieve WCA profile data, then the endpoints would be /api/v0/persons?q={query}
and /api/v0/persons/:wca_id
.
Let me know if you have any further questions!
Thank you for the reply, having reread routes.rb, I understand now. I mostly found it odd that these non-user accounts had avatar key/values, but none shown on the website. Thanks again!
Describe the bug When querying the /search/users?q={query}, users without an avatar (not even the default avatar; simply no avatar at all) return no real data (simply return the default json
{"result":[ ]}
). However, when using the more general /search?q={query} on the same people, the expected response is returned. In addition, making a request to /users/:id with these same no-avatar individuals returns a 404 error code, and a json response of {"user":null}.To Reproduce Steps to reproduce the behavior:
Expected behavior I would expect that making this search would return the same json format as would making a request to any other id. I can only assume it has to do with either the lack of avatar or null "created_at" and "updated_at" keys. However, when making the more general /search?q=query request, the "avatar" keys for the individuals listed above did have values, linking to the default "no avatar" picture. That leads me to assume that the lack of avatar on the main website is not the cause of this issue but rather a side effect.
Screenshots https://imgur.com/gallery/EE4TRPN
Desktop (please complete the following information):
Smartphone (please complete the following information): I don't believe this is relevant in this case.
Additional context I experienced these bugs both in an isolated API rest client, Insomnia, as well as in the browser using a XMLHttpRequest. At first, I thought it may have to do with older IDs, but 2019AGAR01 proves otherwise. I also believed that it may have to do with only having competed once, and then never again, as they would not have ever signed into the WCA website to register again and therefore may not be registered as a user. 2009NAGA01, again, shows that this is not necessarily correct.