Warn about version 0 when saving to sync cache
This should be an error, because the API will never return 0, but most tests don't currently set the version properly in the response JSON.
This commit is contained in:
parent
d857a813b9
commit
3390f2405b
1 changed files with 6 additions and 0 deletions
|
@ -1056,6 +1056,12 @@ Zotero.Sync.Data.Local = {
|
|||
Zotero.debug(json, 1);
|
||||
throw new Error("Missing 'version' property in JSON");
|
||||
}
|
||||
if (json.version === 0) {
|
||||
Zotero.debug(json, 1);
|
||||
// TODO: Fix tests so this doesn't happen
|
||||
Zotero.warn("'version' cannot be 0 in cache JSON");
|
||||
//throw new Error("'version' cannot be 0 in cache JSON");
|
||||
}
|
||||
// If direct data object passed, wrap in fake response object
|
||||
return json.data === undefined ? {
|
||||
key: json.key,
|
||||
|
|
Loading…
Reference in a new issue