I made this ticket to let you know about a bug on the new prediction api. It is in beta which I imagine is the best time to report a bug
The date “ended_at” provided when the prediction is solved is not the correct one. It is equal to the date “started_at” and therefore is not used much ^^
The “locks_at” is never the date on which the prediction was actually locked. It is automatically set to the initial scheduled lock date.
Reproduce :
Launch prediction for 2 minutes
Lock the prediction prematurely after some seconds or 1 minute if you want.
the locks_at in the lock event is the initial datetime + 2 minutes and not the real locks date
In my implementation, I send the event data to a websocket which allows me to distribute the information in a live overlay. I overloaded the data as I wanted. I need to know the real lock date.
I use the lock date to calculate how long I leave the prediction displayed once locked (30 seconds).
Yes because my overlay must be able to be displayed at any time during the life of the prediction. I therefore permanently store the last state of the prediction on my websocket, which distributes it to the overlay which is its client.
I have to store the lock date because it allows me to know, if I display my overlay in the middle of its life cycle, how long I let this step display
Coming back to this locks_date problem, I think this is actually not intended at all.
The “channel.prediction.lock” event returns a “locks_at” while “channel.prediction.end” returns a “locked_at”. Each time the information is wrong. None contains the real locking date but only the programmed one when the term has changed as if we wanted to talk about the past.