API-based "Restore to Online Library"
Restores the "Restore to Zotero Server" functionality, now using the API: 1. Get all remote keys and send `DELETE` for any that don't exist locally. 2. Upload all local objects in full (non-patch) mode using only library version so that the remotes are overwritten. 3. Reset file sync history, causing all files to be uploaded (or, more likely, reassociated with existing remote files). Since these are treated as regular updates on the server, they'll sync down to other clients normally. Unsynced changes by other clients might still trigger conflicts. This and Reset File Sync History can also now be run on group libraries, with a library selector in the Reset pane (which I forgot to do with React). The full sync option is now removed from the Reset pane, since there wasn't ever really a reason to run it manually. We should be able to reimplement Restore from Online Library (#1386) using the inverse of this approach. Closes #914
This commit is contained in:
parent
885ed6039f
commit
f353b7ca61
14 changed files with 697 additions and 225 deletions
|
@ -122,7 +122,7 @@ describe("Zotero.Sync.Storage.Local", function () {
|
|||
yield attachment.saveTx();
|
||||
|
||||
var local = Zotero.Sync.Storage.Local;
|
||||
yield local.resetAllSyncStates()
|
||||
yield local.resetAllSyncStates(attachment.libraryID)
|
||||
assert.strictEqual(attachment.attachmentSyncState, local.SYNC_STATE_TO_UPLOAD);
|
||||
var state = yield Zotero.DB.valueQueryAsync(
|
||||
"SELECT syncState FROM itemAttachments WHERE itemID=?", attachment.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue