Commit graph

6 commits

Author SHA1 Message Date
Dan Stillman
db0fa3c33e Async DB megacommit
Promise-based rewrite of most of the codebase, with asynchronous database and file access -- see https://github.com/zotero/zotero/issues/518 for details.

WARNING: This includes backwards-incompatible schema changes.

An incomplete list of other changes:

- Schema overhaul
  - Replace main tables with new versions with updated schema
  - Enable real foreign key support and remove previous triggers
  - Don't use NULLs for local libraryID, which broke the UNIQUE index
    preventing object key duplication. All code (Zotero and third-party)
    using NULL for the local library will need to be updated to use 0
    instead (already done for Zotero code)
  - Add 'compatibility' DB version that can be incremented manually to break DB
    compatibility with previous versions. 'userdata' upgrades will no longer
    automatically break compatibility.
  - Demote creators and tags from first-class objects to item properties
- New API syncing properties
  - 'synced'/'version' properties to data objects
  - 'etag' to groups
  - 'version' to libraries
- Create Zotero.DataObject that other objects inherit from
- Consolidate data object loading into Zotero.DataObjects
- Change object reloading so that only the loaded and changed parts of objects are reloaded, instead of reloading all data from the database (with some exceptions, including item primary data)
- Items and collections now have .parentItem and .parentKey properties, replacing item.getSource() and item.getSourceKey()
- New function Zotero.serial(fn), to wrap an async function such that all calls are run serially
- New function Zotero.Utilities.Internal.forEachChunkAsync(arr, chunkSize, func)
- Add tag selector loading message
- Various API and name changes, since everything was breaking anyway

Known broken things:

- Syncing (will be completely rewritten for API syncing)
- Translation architecture (needs promise-based rewrite)
- Duplicates view
- DB integrity check (from schema changes)
- Dragging (may be difficult to fix)

Lots of other big and little things are certainly broken, particularly with the UI, which can be affected by async code in all sorts of subtle ways.
2014-08-06 22:59:37 -04:00
Dan Stillman
b7cba469f0 Add pause() method to ConcurrentCaller
Delay running any new functions for the specified time
2014-08-06 22:14:58 -04:00
Dan Stillman
51713c8030 ConcurrentCaller updates 2014-08-06 22:14:58 -04:00
Dan Stillman
fae742c94e Remove errant letter 2013-08-21 01:03:10 -04:00
Dan Stillman
2d7d72fb2a Upgrade Q, and change allResolved() to allSettled()
Not fully tested
2013-08-16 18:15:00 -04:00
Dan Stillman
7fbfdce00e ConcurrentCaller -- run a fixed number of concurrent async functions
If the functions return promises, the caller will wait until they're
fulfilled and slots open to start new functions.
2013-03-26 02:50:00 -04:00