ppy / osu-web

the browser-facing portion of osu!
https://osu.ppy.sh
GNU Affero General Public License v3.0
982 stars 384 forks source link

Beatmap set APIv2 endpoint can return fail counts but no exit counts #6543

Closed bdach closed 4 years ago

bdach commented 4 years ago

Detected lazer-side at ppy/osu#9937.

Hitting https://osu.ppy.sh/api/v2/beatmapsets/1205458 from lazer returns the following response. The point of note here is beatmaps[0].failtimes, which has a fail array property of length 100, but no corresponding exit property of the same length. Note that the converts are fine.

Unsure if it's an actual issue or if it's by design as the endpoint in question seems to be undocumented but it might be worth investigating. I'll probably add a guard for this lazer-side but I'm not quite sure how this response is to be interpreted generally (seems that if missing, zeroes should be assumed?)

nanaya commented 4 years ago

Web doesn't do anything with the data. It returns whatever stored in database as is and web doesn't create those data.

bdach commented 4 years ago

Alright, fair enough. Not sure whether to direct this somewhere else but clearly here isn't the right place. Thanks.

nanaya commented 4 years ago

Also the ones with missing exit just means they're missing from database. Web could be updated to always return fail and exit even when they're missing.

nanaya commented 4 years ago

Looking again, the title is confusing. It implies the count might differ but it's impossible (the code always builds array of length 100). Either there's an array or there's none. (again, if both are always needed, it could be done - those will be just all zeros)

bdach commented 4 years ago

Also true. Couldn't find a better phrasing for the title.