Commit graph

5338 commits

Author SHA1 Message Date
Dan Stillman
6907af86fd Add XPCOM clearTimeout() and remove Zotero.wait()
Properly emulate setTimeout() with support for cancelling timers.
2016-05-17 13:43:11 -04:00
Dan Stillman
a285e97815 Remove pumpGenerator/promiseGenerator
And update integration code to use ES6 generators and Bluebird's .each()
instead.
2016-05-17 13:43:11 -04:00
Dan Stillman
d8025be676 Ignore sanitization changes when comparing notes in conflict
Until we have a consistent way of sanitizing HTML on client and server, account
for differences manually. More differences between HTMLPurifier and TinyMCE
should be added as necessary.
2016-05-17 02:33:53 -04:00
Dan Stillman
6f04b34d59 Close #945, Optimize bulk reload on multi-item changes 2016-05-16 18:25:35 -04:00
Dan Stillman
56dcd6da26 Add file sync info/link to File Not Found dialog 2016-05-15 04:24:00 -04:00
Dan Stillman
427234917d Properly test whether file syncing is enabled for a library 2016-05-15 04:22:24 -04:00
Dan Stillman
a8ea8656d2 Fix sync error after changing child item to top-level 2016-05-15 03:34:06 -04:00
Dan Stillman
a7ea92fd52 Mark items with missing full-text cache files as unsynced for full text
Fixes #954, Full-text content processor tries to process missing cache
files on every idle
2016-05-15 01:30:35 -04:00
Dan Stillman
82d00a4e7a Change some instances of attachmentMIMEType to attachmentContentType 2016-05-13 15:56:35 -04:00
Dan Stillman
eb400587e8 Fix various bugs saving from connector and add test 2016-05-13 15:00:54 -04:00
Dan Stillman
55c60a69ac Delay feed fetching 5 seconds at startup
Would be better not to start until after the initial library's items had
been loaded, but that's a little awkward to do from non-window code.
Might make more sense when there's only Standalone.
2016-05-13 02:26:46 -04:00
Dan Stillman
59c0c7fcad Don't include file properties for ZFS-synced libraries
They're disallowed by the API in group libraries and not necessary in personal
libraries, because they're set atomically with the file upload.
2016-05-12 17:00:28 -04:00
Dan Stillman
0f45569ccd Default to NC for My Publications CC license, and reorder SA option 2016-05-12 14:31:57 -04:00
Dan Stillman
62ef910631 Better debug output for full sync 2016-05-12 03:02:50 -04:00
Dan Stillman
92ec1324dc Add a debug flag to prompt or throw on an attempted sync upload
extensions.zotero.sync.debugUploadPolicy = {1, 2}

1 to prompt, 2 to throw

This can be used to test sync functionality without altering the server
state unexpectedly. When prompting, the request body, if any, is logged
to debug output.
2016-05-12 03:02:50 -04:00
Dan Stillman
98cd96eb01 Make DELETE a write method in Zotero.HTTP.isWriteMethod() 2016-05-12 03:02:26 -04:00
Dan Stillman
8bbde63284 Update menu for non-collections when right-clicking on unselected row
Previously, item-dependent menu options in the context menu of
collectionsTreeRow types other than 'collection' weren't updated after
the asynchronous loading of the items. The menu is now updated for all
types, so, e.g., "Empty Trash" is now updated properly after items in
the trash have been loaded.
2016-05-12 02:12:22 -04:00
Dan Stillman
16a58c03be Save scroll position across non-selected changes for collections view 2016-05-09 13:58:33 -04:00
Dan Stillman
9345452601 Don't restore items tree scroll position if selecting new items 2016-05-09 13:58:23 -04:00
Dan Stillman
0bab038925 Fix #984, 5.0: Avoid scrolling items list when adding items via sync 2016-05-09 13:26:33 -04:00
Dan Stillman
53e1e1a9b7 .collectionTreeViewID -> .treeViewID, and add it to Zotero.Item too
Also .collectionTreeViewImage -> .treeViewImage
2016-05-09 12:34:03 -04:00
Dan Stillman
cb8b2bda1b Windows file path fixes
- Fix upgrading of Mozilla-style attachments/storage file paths on upgrade
  (requires re-upgrade)
- Save relative paths using forward slashes for consistency, and convert
  to platform-appropriate slashes on use
2016-05-09 02:30:00 -04:00
Dan Stillman
317b1dfa0f Disable connector switching for 5.0 beta
Don't start the connector pipe (Mac/Linux), don't listen for IPC on the
command-line (Windows), and don't try to release Standalone's lock if DB is
busy when Firefox starts.
2016-05-08 22:38:58 -04:00
Dan Stillman
216900094b Merge branch '4.0' 2016-05-07 13:27:56 -04:00
Dan Stillman
e5edd12371 RTF Scan fixes
- Firefox 46 compatibility
- Stretched progress meters

Partial backport of c5716a395f
2016-05-07 13:18:22 -04:00
Dan Stillman
c7c271f2c4 Fix CSL editor in Firefox 46 2016-05-07 13:17:57 -04:00
Dan Stillman
e1706e15e2 Expand/collapse library fixes
- Fixes #994, 5.0: "+" doesn't expand all collections within a library
- If a container (library, collection) is closed directly, the open state of
  all containers below it are now restored when it's reopened. Previously all
  collections would be closed on a manual reopen (though they might have been
  restored on the next Zotero restart).
- If "-" is pressed, all containers are closed, and reopening the library will
  show only top-level collections.
2016-05-07 04:02:42 -04:00
Dan Stillman
458d110269 Add file for custom sync exceptions 2016-05-06 05:18:09 -04:00
Dan Stillman
950b583e3b Remove obsolete code 2016-05-06 05:00:36 -04:00
Dan Stillman
52ca6d4713 Handle browser-offline error from anywhere in sync code
And don't throw from ConcurrentCaller, because it results in an
unhandled rejection
2016-05-06 05:00:17 -04:00
Dan Stillman
2894e4f462 Fix search by collection 2016-05-06 04:31:49 -04:00
Dan Stillman
8ba9fe7b80 Remove redundant failure delay handling in sync engine
The API client now automatically retries 5xx errors with a backoff schedule, so
the engine doesn't need to do it.
2016-05-06 04:31:49 -04:00
Dan Stillman
a78f923a72 Sync engine cleanup
- Use custom exception for user-initiated sync cancellations, which can bubble
  up to the sync runner -- this should help with a sync stop button (#915)
- Separate out deletions-downloading code
- Refactor delay generator handling on library version mismatch
- Clearer variable names
2016-05-06 04:31:49 -04:00
Dan Stillman
ab4138cf26 Don't throw in Zotero.DataObjects::get() for nonexistent objects
Return false for single ids or skip for multiple ids. This is the original
behavior, but at some point it started throwing an UnloadedDataException. IDs
are always loaded at initialization, though, so we know whether the objects
actually exist.
2016-05-05 06:36:24 -04:00
Dan Stillman
bf3ad6a2a4 Fix test breakage from 3ab335a0 and 09c3a95a 2016-05-05 06:36:24 -04:00
Dan Stillman
b7ad582d99 Merge pull request #991 from adomasven/fix/feed-import-test
Fixes feed-import (and possibly other feed) test unhandled rejections
2016-05-05 06:08:33 -04:00
Adomas Venčkauskas
d4a799b5cb Closes #981. Fixes feed-import (and possibly other feed) test unhandled rejections 2016-05-05 11:07:27 +01:00
Dan Stillman
09c3a95a7e Improve downloaded object processing
- Use an increasing notifier batch size, so objects initially appear one by one
  but then start showing up in batches, up to 50. (UI updates are expensive, so
  for larger syncs we don't want to update after each object.)
- Avoid separate save to update attachment file sync state, which was also
  happening outside of notifier batches (causing individual updates regardless
  of the batch size)
- Add a 10ms delay after processing each object, which keeps the UI responsive
  during downloads. #989 could reduce this to 1 during idle, to save a few
  minutes when downloading very large libraries.
2016-05-05 04:47:01 -04:00
Dan Stillman
4ac2da42d1 Zotero.Items.getAsync() -> get() in itemTreeView::notify() 2016-05-05 02:16:09 -04:00
Dan Stillman
3ab335a078 Don't clear search field when updating items list during sync
Fixes #985
2016-05-05 02:16:08 -04:00
Dan Stillman
8c98abe9dc Fix #988, 5.0: Tab skips Abstract and Extra fields 2016-05-04 21:10:08 -04:00
Dan Stillman
cd5e805b9e Sync logic improvements
- Cancel sync when cancelling conflict resolution window
- Don't try to upload unsynced objects if present in sync queue
2016-05-04 01:39:24 -04:00
Dan Stillman
391f525a75 Close #975, Process conflicts for all batches together 2016-05-03 23:18:42 -04:00
Dan Stillman
f8a0f9ad1d Use synchronous object getters during sync
Since objects should always already be loaded
2016-05-03 18:27:08 -04:00
Dan Stillman
f751495ce8 Remove debug output hover over sync icon 2016-05-03 18:27:08 -04:00
Philipp Zumstein
aef8453924 Fix some for each ... in cases (#978) 2016-05-03 17:51:12 -04:00
Dan Stillman
096ebb188b Try to log a better error for some instances of Zotero.debug(e); 2016-05-03 13:47:37 -04:00
Dan Stillman
72c8711cd3 String::contains() -> indexOf() for Firefox 48 (and 38) compatibility
.contains() was removed in Firefox 48, but .includes() wasn't available until
40, so use indexOf() for now. We can start using .contains() once we no longer
need to support 38 ESR.
2016-05-03 12:08:38 -04:00
Dan Stillman
315100e5ef Remove obsolete style code 2016-05-03 12:06:29 -04:00
Dan Stillman
e8aec31715 Fix various cases of sync errors with read-only libraries
Addresses #983
2016-05-03 02:55:26 -04:00