Raise an error when localVersionPath and remoteVersionPath are not in JSON
As far as I understand, currently Puppet ignores the situation when client has configured non-empty localVersionPath and remoteVersionPath but the server does not send it in the response. Last time I checked, Puppet just waits forever and does not send patches in that case.
We need to make the developer aware that the server does not contain the version properties. I think it should even throw an exception or at least console.error.
@tomalec WDYT?
Fair point, should not be even very costly.
Another thing is that for performance and simplicity, we assume that versions are sent as virst operation object, should we also try to search entire sequence, or just throw an error if sequence abuses convention?
I guess we should check only the first operation objects in the sequence, as the convention tells (because in sequence, the order of operations matters).
The check if the first two operations are version numbers can be made in Puppet debug mode.
Order matters, but according to spec failing test operation should rollback entire sequence, so theoretically position does not matter, as long as replace (sender's version) operation is still after test (sender's, in purist mode).
I think we can make it always
if(shiftedOp.path === this.localVersionPath) is not much more expensive than if(this.debug == true) + implementing debug flag for JSON-Patch-Queue