speedruncomorg / api

REST API Documentation for speedrun.com
351 stars 35 forks source link

A run object can have no category, which is undocumented. #118

Open badBlackShark opened 3 years ago

badBlackShark commented 3 years ago

Titles says it all. I was fetching all unverified runs a couple minutes ago and noticed that two of them failed to parse. Turned out their category was null, which is not documented in the runs docs.

I think if a field is null-able, this should be documented.

ShikenNuggets commented 3 years ago

Can you link the runs? That isn't supposed to be possible.

badBlackShark commented 3 years ago

Both of these runs seem to not exist on the site, but definitely get returned when fetching all unverified runs.

https://www.speedrun.com/hypixel_ag/run/z183glgy https://www.speedrun.com/hypixel_ag/run/m789q6ez

I'm embedding categories in my request, but that shouldn't affect the outcome of whether category is null or not.

badBlackShark commented 3 years ago

Looking at these individually through the API does indeed reveal that a category ID is present, but once embedded the category data is just an empty array.

Nick-NCSU commented 3 years ago

A similar issue also applies to older unverified runs in a different game. https://www.speedrun.com/api/v1/runs?status=new&orderby=submitted&direction=asc&game=9dow9rm1 A decent amount of runs listed here do not exist on the site (example: https://www.speedrun.com/hypixel_sb/run/zgv4r8vz) but are returned by the API.

exodustx0 commented 3 years ago

Both of these runs seem to not exist on the site, but definitely get returned when fetching all unverified runs.

speedrun.com/hypixel_ag/run/z183glgy speedrun.com/hypixel_ag/run/m789q6ez

I've just spotted something that might be relevant:

Both runs have the category zd3ojeed. If you GET /games/hypixel_ag, $.data.categories contains zd3oj9ed. That's a one-character difference. Perhaps these runs somehow had their category ID jumbled? Don't know how that could've happened, and for all I know it's still just a coincidence that these IDs are so similar, but it's the only likely option as far as I can see.

Mango0x45 commented 3 years ago

I think the most likely explanation is that the runs belong to a category that has been deleted. This is a pretty common scenario where mods or admins delete a category and then all the runs for that category get stuck in this weird state where you can't access them via the site

exodustx0 commented 3 years ago

Oh yeah, I keep forgetting about that being a thing. That's probably it.