monday-sdk-js
monday-sdk-js copied to clipboard
[Bug] Storage API Versioning
Describe the bug Storage API does not respect versioning
Steps to reproduce Get something from storage:
this.mondayClientSdk.storage.instance.getItem(key).then(
r => {
const version = r.data.version;
// Keep track of the version
}
);
Store a new value:
this.mondayClientSdk.storage.instance.setItem(key, value).then(
r => console.log(r),
e => console.error(e)
);
Note that a different version is now in stored.
Now try to store a new value using the version retrieved in the first snippet:
this.mondayClientSdk.storage.instance.setItem(key, value, {previous_version: version}).then(
r => console.log(r),
e => console.error(e)
);
This succeeds and does not result in a version_conflict
error as described in the docs.
Expected behavior
A version_conflict
error.