Skip to content
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

Transaction.prototype.setData for verion set for 0 (zero) doesn't check version #67

Open
xantin opened this issue Sep 25, 2017 · 1 comment

Comments

@xantin
Copy link

xantin commented Sep 25, 2017

version = version || -1;

If in transaction call Transaction.prototype.setData = function (path, data, version)
and version has value 0, but an output is internally evaluated as -1 but should be 0 otherwise this use case doesn't work:

I have znode in zookeeper with version e.i. 33 and I will call aforementioned function
Transaction.prototype.setData = function (path, data, 0) and everything will be updated even though this should throw an Exception.BAD_VERSION because version 0 and 33 is different.

@xantin
Copy link
Author

xantin commented Sep 25, 2017

We could do this:

insted of
version = version || -1;
use

if (typeof version !== 'number') {
	version = -1;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant