Copied from Discord:
I think the current problem with multiple choice is that we broadcast the updated answers one-by-one, which means if you are in the bet panel in the middle of this, you could get an inconsistent state where the answer probabilities don't add up to 100%.
Maybe I will create a websocket topic for plural answers: contract/${answer.contractId}/updated-answers, which takes an array of answers.
Then we could deprecate the singular /updated-answer after.
@MentatBot, could you add a broadcastUpdatedAnswers function in backend/shared/src/websockets/helpers.ts, and use it as well as broadcastUpdatedAnswer everywhere? Then update the client to receive those updates as an array of answers.
Copied from Discord: I think the current problem with multiple choice is that we broadcast the updated answers one-by-one, which means if you are in the bet panel in the middle of this, you could get an inconsistent state where the answer probabilities don't add up to 100%.
Maybe I will create a websocket topic for plural answers: contract/${answer.contractId}/updated-answers, which takes an array of answers.
Then we could deprecate the singular /updated-answer after.
@MentatBot, could you add a
broadcastUpdatedAnswers
function inbackend/shared/src/websockets/helpers.ts
, and use it as well as broadcastUpdatedAnswer everywhere? Then update the client to receive those updates as an array of answers.