New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deepstream not updating object properties #96
Comments
Forgot to mention, if you change the last line to: |
Could I ask you to make sure you're using the latest version of the client library? This should have been fixed in release 0.4.2 |
Running client 0.5.0. |
Found it. JSONPath sets its value at https://github.com/deepstreamIO/deepstream.io-client-js/blob/master/src/record/json-path.js#L70. This set is by reference, so when an object property changes, the local copy of the record is updated, but connection.sendMessage is not called. Then, if you manually set the record, it shows as unmodified (https://github.com/deepstreamIO/deepstream.io-client-js/blob/master/src/record/record.js#L102) so connection.sendMessage is still not called. I don't know what the best solution is, but maybe a force update or copy on set would work. |
Deepstream will not push an update to subscribers of a record if that record is an object which has a property that changes. Offending code:
var myObject = {hello:1};
ds.record.getRecord('myRecord').set('mySubrecord',myObject);
//mySubrecord on this client returns {hello:1}, other clients {hello:1}
myObject.hello = 2;
//mySubrecord on this client returns {hello:1}, other clients {hello:1}
ds.record.getRecord('myRecord').set('mySubrecord',myObject);
//mySubrecord on this client returns {hello:2}, other clients {hello:1}
This is specifically happening using the node.js client at 0.5.0, node.js version 5.11.0, and node.js server at 0.9.0.
The text was updated successfully, but these errors were encountered: