deepstreamIO / deepstream.io

deepstream.io server
https://deepstreamio.github.io
MIT License
7.14k stars 382 forks source link

Maximum Version Number #1072

Open grydstedt opened 4 years ago

grydstedt commented 4 years ago

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.

yasserf commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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

grydstedt commented 4 years ago

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