Anki/tests
Damien Elmes bc9f6e6a24 add USNs
Decks now have an "update sequence number". All objects also have a USN, which
is set to the deck USN each time they are modified. When syncing, each side
sends any objects with a USN >= clientUSN. When objects are copied via sync,
they have their USNs bumped to the current serverUSN. After a sync, the USN on
both sides is set to serverUSN + 1.

This solves the failing three way test, ensures we receive all changes
regardless of clock drift, and as the revlog also has a USN now, ensures that
old revlog entries are imported properly too.

Objects retain a separate modification time, which is used for conflict
resolution, deck subscriptions/importing, and info for the user.

Note that if the clock is too far off, it will still cause confusion for
users, as the due counts may be different depending on the time. For this
reason it's probably a good idea to keep a limit on how far the clock can
deviate.

We still keep track of the last sync time, but only so we can determine if the
schema has changed since the last sync.

The media code needs to be updated to use USNs too.
2011-09-13 21:10:21 +09:00
..
off some initial sync work 2011-05-29 08:13:54 +09:00
support ensure duplicate model creation times are accounted for 2011-08-26 22:33:24 +09:00
__init__.py initial commit from hg 2008-09-27 23:50:03 +09:00
shared.py drop sqlalchemy; massive refactor 2011-04-28 09:23:53 +09:00
test_cards.py top level groups 2011-09-07 01:31:46 +09:00
test_deck.py add a new default for counts() 2011-09-07 19:11:37 +09:00
test_find.py move tags into deck; code into separate file 2011-08-28 13:44:29 +09:00
test_latex.py move db 2011-09-12 05:03:31 +09:00
test_media.py add change detection 2011-09-12 03:11:06 +09:00
test_models.py top level groups 2011-09-07 01:31:46 +09:00
test_sched.py add USNs 2011-09-13 21:10:21 +09:00
test_stats.py move models into the deck table 2011-08-27 22:27:09 +09:00
test_sync.py add USNs 2011-09-13 21:10:21 +09:00
test_undo.py add a new default for counts() 2011-09-07 19:11:37 +09:00