2
votes

I have an iOS/Android application that is using Azure Mobile Sync. Most of the time everything works as you would expect but there is a scenario that is dogging me quite a bit. The scenario is:

Phone A creates a record. Phone B creates a record. Phone A updates phone B's record. Phone B updates phone A's record. Phone C gets both record creation and the latest updates correctly from the cloud. Phone A has it's original record but fails to pull in phone B's update. Phone B has it's original record but fails to pull in phone A's update.

I have verified there are not sync conflicts and the data is being pulled and most of the time this doesn't happen. Mostly, phone A/B/C all get updated properly. I extracted the sqlite database from my Android phone and I've checked the _operations table and I do not see any sync operations for the records in question. It's like the system thinks it's already up to date and doesn't try to sync.

Is there a way to force pull everything from the cloud? Thanks!

1

1 Answers

3
votes

It's like the system thinks it's already up to date and doesn't try to sync.

Is there a way to force pull everything from the cloud? Thanks!

I assumed that you are using Incremental Sync describled as follows:

Incremental Sync: the first parameter to the pull operation is a query name that is used only on the client. If you use a non-null query name, the Azure Mobile SDK performs an incremental sync. Each time a pull operation returns a set of results, the latest updatedAt timestamp from that result set is stored in the SDK local system tables. Subsequent pull operations retrieve only records after that timestamp.

Details you could follow How offline synchronization works .

You could try to pass null as the query ID, then all records would be retrieved on every PullAsync request as follows:

await todoTable.PullAsync(null, syncTable.Where(u => u.xxx == "xxx"));

Moreover, you could leverage fiddler to capture the network traces when you encounter this problem, then you could inspect the specific request parameters to narrow this issue.