don't double-encode JSON

This commit is contained in:
Maciek Nowacki 2021-03-12 11:08:19 -07:00
parent 0a89138a79
commit 97a746c572

View File

@ -79,10 +79,10 @@ class XhrListener {
for (let client of c.clients) {
let nonce: string = crypto.randomBytes(4).toString("hex");
// TODO: verify the nonce against the received reply, which we currently ignore
client.directMessage(JSON.stringify({
client.directMessage({
message_type: "broadcast",
message: { event_type: event, seq_id: nonce, examId: archMsg.examId }
}));
});
dmCount++;
}
// dmCount of 1 would be normal. more than 1 is odd, but not necessarily bad. 0 means Exam UI has gone away somehow.