From c06894b29175ad2cf2903ccad4e4206399803483 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Sat, 10 Sep 2022 16:42:49 +0200 Subject: xP: fix command sequence number generation --- xP/public/xP.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xP/public') diff --git a/xP/public/xP.js b/xP/public/xP.js index 95ee879..a9fc96c 100644 --- a/xP/public/xP.js +++ b/xP/public/xP.js @@ -110,8 +110,9 @@ class RelayRpc extends EventTarget { if (typeof params !== 'object') throw "Method parameters must be an object" + // Left shifts in Javascript convert to a 32-bit signed number. let seq = ++this.commandSeq - if (seq >= 1 << 32) + if ((seq << 0) != seq) seq = this.commandSeq = 0 this.ws.send(JSON.stringify({commandSeq: seq, data: params})) -- cgit v1.2.3-70-g09d2