ZFS file sync overhaul for API syncing
This mostly gets ZFS file syncing and file conflict resolution working with the API sync process. WebDAV will need to be updated separately. Known issues: - File sync progress is temporarily gone - File uploads can result in an unnecessary 412 loop on the next data sync - This causes Firefox to crash on one of my computers during tests, which would be easier to debug if it produced a crash log. Also: - Adds httpd.js for use in tests when FakeXMLHttpRequest can't be used (e.g., saveURI()). - Adds some additional test data files for attachment tests
This commit is contained in:
parent
6d46b06617
commit
73f4d28ab2
44 changed files with 11226 additions and 5239 deletions
|
@ -19,28 +19,20 @@ describe("Zotero.Sync.Data.Engine", function () {
|
|||
var caller = new ConcurrentCaller(1);
|
||||
caller.setLogger(msg => Zotero.debug(msg));
|
||||
caller.stopOnError = true;
|
||||
caller.onError = function (e) {
|
||||
Zotero.logError(e);
|
||||
if (options.onError) {
|
||||
options.onError(e);
|
||||
}
|
||||
if (e.fatal) {
|
||||
caller.stop();
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
||||
Components.utils.import("resource://zotero/config.js");
|
||||
var client = new Zotero.Sync.APIClient({
|
||||
baseURL: baseURL,
|
||||
baseURL,
|
||||
apiVersion: options.apiVersion || ZOTERO_CONFIG.API_VERSION,
|
||||
apiKey: apiKey,
|
||||
concurrentCaller: caller,
|
||||
apiKey,
|
||||
caller,
|
||||
background: options.background || true
|
||||
});
|
||||
|
||||
var engine = new Zotero.Sync.Data.Engine({
|
||||
apiClient: client,
|
||||
libraryID: options.libraryID || Zotero.Libraries.userLibraryID
|
||||
libraryID: options.libraryID || Zotero.Libraries.userLibraryID,
|
||||
stopOnError: true
|
||||
});
|
||||
|
||||
return { engine, client, caller };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue