learningequality/ka-lite — pull request #1909 by bcipolli (2014-04-07 23:36:30+00:00)
Title: Hotfix for #1903: metadata check was wrong, outer loop should be model dependencies

Two syncing issues; one central, the other distributed:
1. We were too stringent on our check on the metadata counter. Change `>` to `>=`
2. We had assumed that there were no inter-device object dependencies. This was wrong. For example:
* A `FacilityUser` was created on Device B, and synced to Device A
* An `ExerciseLog` was created on Device A
* Device C joins the network.
* If Device C gets data from Device A before Device B, then the `ExerciseLog` will refer to an unrecognized user.

**Testing:**
* Tested using the data stored in the issue. Will push up to the staging server shortly.

@jamlaex This is a simple, but important syncing change. Can you take a looksie?