deepstreamIO / deepstream.io-client-js

The Browser / Node.js Client for deepstream.io
Other
294 stars 109 forks source link

Fix: Version conflict when receiving 'PATCH' action causes record to go into 'MERGING' state indefinitely #570

Closed Vortex375 closed 2 years ago

Vortex375 commented 2 years ago

I had a producer which frequently updated a record using the "patch" operation (i.e. setting only one property of the record). I noticed that occasionally my subscribers stopped handling updates.

Through debugging I found that when the subscriber stopped handling updates, the record would go into "MERGING" state and then never leave that state. After further debugging, I think that the cause for this is that the record issues a "read" request but forgets to register a callback. Thus, the read response is not handled and the record never leaves the "MERGING" state.

Properly registering the callback for the read request seems to fix the problem I was experiencing.

jaime-ez commented 2 years ago

Hi, thanks for the pull request! Your fix makes sense :+1: