If no one has voted and someone clicks the "Reveal votes" button, the room will crash and kick everyone out.
This is caused by the mean being calculated on the server, where it results in NaN in cases where no one has voted. This doesn't serialise correctly due to the JSON specification not allowing this value.
We could turn off strict JSON serialisation and send NaN, or we could handle the NaN result on the server and send 0 instead.
We could put some client code in place that doesn't allow votes to be revealed until everyone / someone has voted, but this could be in addition.
If no one has voted and someone clicks the "Reveal votes" button, the room will crash and kick everyone out.
This is caused by the
mean
being calculated on the server, where it results inNaN
in cases where no one has voted. This doesn't serialise correctly due to the JSON specification not allowing this value.We could turn off strict JSON serialisation and send NaN, or we could handle the NaN result on the server and send 0 instead.
We could put some client code in place that doesn't allow votes to be revealed until everyone / someone has voted, but this could be in addition.