turnpike
turnpike copied to clipboard
Autobahn.js RequestID differs from turnpikes
I am running turnpike on: Architecture: armv7l Byte Order: Little Endian Which is 32Bit.
Autobahn.js RequestID differs from turnpikes.
I think the problem is: type ID uint
Autobahn.js chooses for example this ID: 2267980555616256 Which overflows with uint on an 32bit system.
At a quick glance I couldn't find any information on what bit size the ID is.
Ah I found it:
IDs in the global scope MUST be drawn randomly from a uniform distribution over the complete range [0, 2^53]
Which means type ID uint needs to be uint64
Good catch. I changed the maxID
const to int64, but I forgot the ID type.
I found another 10 cases where an uint is used for an ID. All in router.go. They are mostly related to callbacks. The program will most likely panic now due an overflow error on 32Bit system instead of handling it while decoding(?).