Search code examples
c#web-servicesrestgoogle-apigdata-api

Strange modified times on server when updating contacts using Google GData API


I'm trying to develop a sync tool for Google contacts however I'm seeing some odd behavior.

In short, here's my problem:

I send request to modify a contact at time X.
The request will take X+1ms.
The entire process of snycing takes X+2ms.
I will update my timestamp at X+2ms.
For whatever reason the contact I modified shows an last modified time stamp of X+20ms and so gets sent back the other direction during the next sync. Bad.

The Google GData .NET Library I'm using is synchronous so it's not as if there are calls out in the ether that simply haven't finished.

Here's a pastebin of the request/response/and call times.

http://pastebin.com/Bw01S3C0

Any ideas?


Solution

  • There is a little known first-order Special Relativistic effect that limits how closely synchronized multiple clocks can be at the Earth's surface. Two clocks can be synchrronized to each other exactly, but three or more cannot be synchronized more precisely than (if I recall the number correctly from 3rd year Physics) about 4 or 5 ms. While most Special Relativistic effects are 2nd or 3rd order in the speed of light c, this one is first order in c and thus easily detectable with modern hardware.