flerda/Anki-Android — pull request #19 by iniju (2013-01-13 23:11:49+00:00)
Title: V2.0.1 setmod at fullsync

This is a fix for our sync method.
The problem: If sync produces a sanity error for any reason (there used to be a bug in some shared decks adding, fixed in dev when we brought libanki up to date), then the suggested full sync from the dialog fails.
This full sync attempt, although failed (due to an ankiweb bug, reported) should mark the collection for full sync next time. This second full sync would succeed and fix the problem, but due to this bug that this commit fixes, it doesn't mark it as such, so the next sync will be normal sync which will suffer again from the sanity fail.

Result: If sync sanity fail happens, we can't sync anymore.

This fix correctly bumps the mod time of the collection, when we initiate the first full sync, so that even if this fails, next sync will also be full sync which suceeds (ankiweb only kills the first full sync after sync sanity fail).

Please note that this mod time bumping should only happen when we explicitly request full sync (in anki desktop from the Maintenance menu, in ankidroid from the dialog of sanity fail or deck corruption). If full sync results as conflict during normal sync then, there's no need for this code to run.