Commit graph

37 commits

Author SHA1 Message Date
Dan Stillman
5901a3c7af Fix possible skipped group download when another group is archived 2017-10-26 19:05:46 -04:00
Dan Stillman
8b7f33826e Fix sync test after 7b0ed6da81 2017-08-05 01:41:21 +02:00
Dan Stillman
e89778c1ab Remove some code that's unnecessary now that we're Fx52+ everywhere 2017-06-23 05:03:11 -04:00
Dan Stillman
cd6079d869 Relax last-sync-time check in sync runner test 2017-06-06 02:14:23 -04:00
Dan Stillman
898a1dc679 Add alternative to padStart for test in Fx45 2017-06-01 16:44:11 -04:00
Dan Stillman
05ff16c17f Fix some breakage from 013dc958b3 2017-06-01 15:39:42 -04:00
Dan Stillman
ede03f4366 Update some Sinon reset() calls
In Sinon 2, reset() now resets both behavior and history, so if a stub
specifies behavior and we want to use it again, we have to call
resetHistory().
2017-06-01 15:39:42 -04:00
Dan Stillman
6d18b46165 Fix test breakage after 5ff2a59f87
And remove all instances of `publicationsLibraryID`
2017-04-13 00:15:05 -04:00
Dan Stillman
80a0826eb6 Add archived group handling to sync runner
- Archive remotely missing that user chooses to keep
- Ignore archived groups that don't existing remotely
- Unarchive groups that become available again
2017-02-24 02:36:18 -05:00
Dan Stillman
fbd21bae16 Don't update feeds after syncs during tests
This reverts commit 60befe52e4 and adds a
better fix that leaves the notifier event in place. Feeds just don't
need to update after syncs during tests.
2016-12-08 05:58:46 -05:00
Adomas Venčkauskas
60befe52e4 Remove database closed errors in sync tests 2016-12-08 12:16:44 +02:00
Dan Stillman
8799bb4ebd Remove Travis debugging 2016-11-29 03:29:45 -05:00
Dan Stillman
30d0858ebf Travis debugging 2016-11-29 01:42:15 -05:00
Dan Stillman
01ba8dfc34 Don't show missing-group warning for skipped groups 2016-07-20 15:36:31 -04:00
Dan Stillman
48260e22a9 Increase tolerance on last-sync time check to prevent test failures
And compare integer timestamps directly instead of relying on implicit Date
coercion
2016-07-19 20:22:58 -04:00
Dan Stillman
5fee2bf4ca Prompt to reset library data/files on loss of write access
On reset, items are overwritten with pristine versions if available and deleted
otherwise, and then the library is marked for a full sync. Unsynced/changed
files are deleted and marked for download.

Closes #1002

Todo:

- Handle API key access change (#953, in part)
- Handle 403 from data/file upload for existing users (#1041)
2016-07-19 19:05:17 -04:00
Dan Stillman
9e6565fe00 Skip skipped groups when syncing
Except if a library list is passed to Zotero.Sync.Data.Runner.sync() (which
isn't done currently but will be in #1053)

Follow-up to #1033
2016-06-27 16:48:32 -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
e0e744f9b1 Use multi-item requests for full-text writes
This is necessary to get a library version after the write instead of an
item version. Otherwise after a full-text write, the main library
version is behind, so the next sync checks all object types for that
library instead of getting a 304.

Full text is batched up to 500K characters or 10 items, whichever is
less.

This also switches to using ?format=versions for /fulltext requests,
which isn't currently necessary but reflects what it's actually doing.
2016-05-03 01:17:52 -04:00
Dan Stillman
1c90a77298 Fix handling of 413 for over-quota errors
And fix handling of custom error dialog button text/callbacks in
general.
2016-04-26 18:59:23 -04:00
Dan Stillman
4eee369b66 Use /keys/current for key requests
Possible after https://github.com/zotero/dataserver/commit/beb38579ca1
2016-04-25 02:51:35 -04:00
Dan Stillman
e7d27ee0f3 Close #931, [Async DB] Update long tag fixer 2016-04-21 11:46:23 -04:00
Dan Stillman
a1ce85decb Overhaul object downloading/processing during data syncs
Previously, objects were first downloaded and saved to the sync cache,
which was then processed separately to create/update local objects. This
meant that a server bug could result in invalid data in the sync cache
that would never be processed. Now, objects are saved as they're
downloaded and only added to the sync cache after being successfully
saved. The keys of objects that fail are added to a queue, and those
objects are refetched and retried on a backoff schedule or when a new
client version is installed (in case of a client bug or a client with
outdated data model support).

An alternative would be to save to the sync cache first and evict
objects that fail and add them to the queue, but that requires more
complicated logic, and it probably makes more sense just to buffer a few
downloads ahead so that processing is never waiting for downloads to
finish.
2016-03-23 04:29:04 -04:00
Dan Stillman
6ac35c75c1 Fix display of sync error icon on error 2016-03-22 22:44:02 -04:00
Dan Stillman
b3e14644f2 Fix sync tests 2016-01-18 13:50:46 -05:00
Dan Stillman
50b46bdb19 Don't bother doing a full DB reset after sync tests
Tests should make no assumptions about the presence of bundled files and
should do a full resetDB() if they need them. But most tests don't need
them, and they're very slow to install. We can reconsider this if we
drastically speed up DB resetting in tests (e.g., by caching a pristine
data directory).
2016-01-08 03:23:35 -05:00
Adomas Venčkauskas
ffd9a07164 Restores sync credential functionality of 4.0.
Improves UX of sync authentication.
The account is now linked and unlinked and an API key related to
the client is generated transparently in the background.
The API key is deleted on unlinking.
No sync options are allowed before linking an account.
2015-12-14 23:55:28 +00:00
Dan Stillman
62aeb1da32 Full-text syncing support via API [DB reupgrade] 2015-11-12 02:54:51 -05:00
Dan Stillman
687ee6ba07 Fix sync error from items dragged between libraries before first sync
And fix bug in Zotero.URI.getURILibrary()
2015-11-02 20:36:47 -05:00
Dan Stillman
d07756d68d Store API key in login manager, and add temp field in prefs 2015-11-02 03:22:37 -05:00
Dan Stillman
73f4d28ab2 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
2015-10-29 04:38:27 -04:00
Dan Stillman
62e586073d concurrent-caller.js -> concurrentCaller.js 2015-10-29 02:49:31 -04:00
Dan Stillman
7633c7de30 Set test timeout in resetDB() instead of separate this.timeout() calls
'thisArg: this' should be passed to resetDB to have it adjust the
timeout
2015-09-29 04:42:12 -04:00
Aurimas Vinckevicius
995bc9667b Open a window for syncRunner tests
For some reason setTimeout in waitForWindow sometimes does not fire without a window open.
2015-09-21 17:08:23 -05:00
Aurimas Vinckevicius
d122323dbf Fix fullText tests on Windows 2015-09-21 17:08:22 -05:00
Aurimas Vinckevicius
88ab129ffb Add Feed and FeedItem
Also:
* _finalizeErase in Zotero.DataObject is now inheritable
* Call _initErase before starting a DB transaction
* removes Zotero.Libraries.add and Zotero.Libraries.remove (doesn't seem like this is used any more)
2015-09-21 17:08:21 -05:00
Dan Stillman
984789d304 API syncing megacommit
There's a lot more to do, and this isn't ready for actual usage, but the
basic functionality is mostly in place and has decent test coverage. It
can successfully upgrade a library last used with classic syncing and
pull down changes via the API. Uploading mostly works but is currently
disabled for safety until it has better test coverage.

Downloaded JSON is first saved to a cache table, which is then used to
populate other tables and later for generating PATCH requests and
automatically resolving conflicts (since it shows what was changed
locally and what was changed remotely). Objects with unmet dependencies
or unknown fields are skipped for now but don't block the rest of the
sync.

Some of the bigger remaining to-dos:

- Tests for uploading
- Re-do the preferences to get an API key
- File sync integration
- Full-text syncing integration
- Manual conflict resolution (though this already includes much smarter
  conflict handling that automatically resolves many conflicts)
2015-07-20 18:16:57 -04:00