#Changes in Round's Id

13 messages · Page 1 of 1 (latest)

unreal apex
#

Do Broadcast rounds' Id Change ?
I built a tool that stores some rounds data in DB to use them later in getting these rounds data from lichess broadcast's API,
Today my APP Crashed, on investigation I found that Id(s) related to rounds ( which I stored earlier in database ) are not the same in lichess broadcast API, The issue was solved once I deleted those rounds then re-inserted them with new Id(s),

I noticed that ID changes occurs in ongoing and comming rounds ! Not in finished rounds .
If this is the normal behaviour, when do these changes happen ?
to sync updates in my DB..

proven walrus
#

I think a round gets its id when it is created.
And it won't change after that.
But maybe some rounds have been deleted, and then recreated, and they got new ids by that. Is a guess.

unreal apex
# proven walrus I think a round gets its id when it is created. And it won't change after that. ...

I have two featers:
first: Get Data for finished rounds and games, there is no issue with it because round's id for finished rounds will not be changed ( or recreated )

the second one:

is to get data for the round which is about to start, to get all games info related
I use this url:
'https://lichess.org/api/broadcast/{broadcastTournamentSlug}/{broadcastRoundSlug}/{broadcastRoundId => this is the round's id stored in my database}'

unreal apex
#

when rechecking the rounds in lichess broadcast API, I found all ongoing and upcomming are changed

#

changed from those I eairly stored in my database

proven walrus
#

Anyone can create a broadcast.
It is possible to create rounds in the broadcast.
It is possible to mark them as finished.
It is then possible to delete the rounds.

So if you have stored the rounds while they existed, you will have data that the broadcast doesn't have.

unreal apex
#

SO I have to make something to update rounds in database upon getting 404 and then retry the request ?

as you say rounds may be deleted and recreated at any point of time, from somebody..

unreal apex
proven walrus
#

If you are the creator of the broadcast and the rounds, you can decide for yourself to never delete rounds. Then you can expect the round ids to stay as they were when you first created them.
If you are exporting someone elses broadcasts, you never know when/if they ever will delete rounds or not.
So you "can't" have expectations on the rounds existing.
Or maybe they most often do exists, and there are some weird situation for the broadcast creators which has lead them to delete their rounds and make new ones.
If you want to try to handle that in some way, like matching the names of the rounds or PGN in the rounds or something, that would be up to you.

unreal apex
#

Okay, Up to the point

unreal apex