Zotero is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources.
Go to file
Dan Stillman fabc2ba6a2 Always start at MAX() + 1 for Zotero.ID.get(), and deasyncify
Instead of getting batches of unused primary key ids, even if they're lower
than other ids, which for some reason seemed like a good idea in 2008, just do
a `MAX()` on the table at startup and return the next available id on each call
to `Zotero.ID.get()`. This is much simpler, and not reusing ids allows them to
be used as a chronological sort field.

While SQLite's `SELECT last_insert_rowid()` could return auto-increment values,
it's unsafe with async DB access, since a second `INSERT` can come in before
the first `last_insert_rowid()` is called. This is true even in a transaction
unless a function that calls it is never called in parallel (e.g., with
`Zotero.Promise.all()`, which can be faster than sequential `yield`s).

Note that the next id is always initialized as MAX() + 1, so if an object is
added and then deleted, after a restart the same id will be given. (This is
equivalent to (though unrelated to) SQLite's `INTEGER PRIMARY KEY` behavior,
as opposed to its `INTEGER PRIMARY KEY AUTOINCREMENT` behavior.)

Closes #993, Feed items out of order
2016-03-30 01:39:43 -04:00
chrome Always start at MAX() + 1 for Zotero.ID.get(), and deasyncify 2016-03-30 01:39:43 -04:00
components Add FeedReader 2016-03-22 03:38:49 -04:00
defaults/preferences Various feeds changes 2016-03-22 06:56:36 -04:00
resource Overhaul object downloading/processing during data syncs 2016-03-23 04:29:04 -04:00
styles@2a33b37ec4 Update version and submodules 2016-03-15 03:31:08 -04:00
test Throw an error from queryAsync() if onRow throws an error 2016-03-28 17:47:25 -04:00
translators@0ef37cc957 Update version and submodules 2016-03-15 03:31:08 -04:00
.gitattributes Fix enforcing of Unix newlines for SQL files 2016-02-26 18:37:44 -05:00
.gitmodules Add Chai-as-Promised 2015-09-18 03:34:03 -05:00
.travis.yml Update test config for new Firefox download URLs 2015-11-19 16:22:21 -05:00
chrome.manifest Add Ukrainian locale 2014-05-16 14:51:49 -04:00
CONTRIBUTING.md Create CONTRIBUTING.md 2016-02-08 19:28:05 -05:00
COPYING Switch client code license to Affero GPL version 3 2011-05-18 18:34:22 +00:00
install.rdf Remove "alpha" from version number (handled by build script) 2016-03-20 15:00:38 -04:00
README.md Merge branch '4.0' 2015-11-01 21:22:13 -05:00
update.rdf Remove "alpha" from version number (handled by build script) 2016-03-20 15:00:38 -04:00

Zotero

Build Status

Zotero is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources.

Please post feature requests or bug reports to the Zotero Forums. If you're having trouble with Zotero, see Getting Help.

For more information on how to use this source code, see the Zotero wiki.