deepstream.io icon indicating copy to clipboard operation
deepstream.io copied to clipboard

Maximum Version Number

Open grydstedt opened this issue 4 years ago • 4 comments

Seeing this when running a server for a long time. Client Version 4.1.3.

Completely locks up the server

RECORD_UPDATE_ERROR | RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= -2147483648 and <= 2147483647. Received 2151554877

Presumably something incrementing past integer max.

grydstedt avatar May 23 '20 09:05 grydstedt

Easiest way to deal with this is to do rolling. If the number is 2147483647 then go back to zero. Will end up having all the clients needing to just accept remote.

Best way of doing that is probably sending out a custom message inform clients to do so via the protocol. It's aint great, but the client would break eitherways due to same error.

I'm no longer maintaining ds, happy to accept a patch if anyone raises it.

Easiest way to test would be to use setData(name, 2147483646, data) api and then updating normally.

yasserf avatar May 23 '20 10:05 yasserf

@grydstedt to be clear, as long as you don’t need server side merging, if you stick, to using ‘set’ without paths, enable the hot path prefix on the server config to include your record pattern and ensure the client side merge resolution is accept remote for that pattern it will work by forcing the version to 1 without you needing a patch.

yasserf avatar May 29 '20 22:05 yasserf

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt

This will actually fix the issue on the server, just needs to polyfilled on Client

yasserf avatar Jul 04 '20 22:07 yasserf

Haven't had time to look at a fix for this unfortunately. For now we'll have to restart the server on some interval

grydstedt avatar Jul 07 '20 07:07 grydstedt