Hacker News new | ask | show | jobs
by WatchDog 126 days ago
Clicking the button sometimes displays an error:

    Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Looking at the network tab, the POST request to the commit API returns a 409 error with the message:

    Commitment already pending for Round 26020619. Please wait for settlement before starting a new round.
1 comments

Oh yes, its only one commitment per call... this is a UI handling issue, will resolve it... the backend by design only takes one commitment per player, till it is resolved/revealed... Thanks
This happened on the first click opening the page, no other commit request in progress from myself, although maybe it's conflicting with other users.
Oh ok... so then thats definitely a bug then... actually drand issues randomness every 3 seconds... so may be multiple on the same drand round has a bug... will correct that... Thanks
I just checked the code and it was a small demo/front-end issue of assigning the player_id (in javascript)... have corrected it now : )

The logic of back end api (written in go, commitment stored in firestore), is intact, the 409 will come only if the same user tries to commit again before the reveal, this is by design.