Confirmed users
927
edits
Tarek.ziade (talk | contribs) |
|||
Line 107: | Line 107: | ||
The client should keep track of the last time it sent updates to the server, and send updates when there are newer applications. | The client should keep track of the last time it sent updates to the server, and send updates when there are newer applications. | ||
The updates are sent with: | The updates are sent with: | ||
POST {collection}? | POST {collection}?lastget={timestamp} | ||
{origin: {...}, ...} | {origin: {...}, ...} | ||
Line 120: | Line 118: | ||
{received: timestamp} | {received: timestamp} | ||
<tt> | <tt>lastget</tt> should be the time of the last GET (that the client did), and the server checks it against the time of the last POST to the collection. If a client is issuing a POST but hasn't seen updates from another client, then the client receives a 412 Precondition Failed. | ||
{status: "failure", reason: "conflict"} | {status: "failure", reason: "conflict"} | ||
'''NOTE:''' | '''NOTE:''' We could use (If-Unmodified-Since or If-Match or ETag) instead of lastget. We are using float timestamps instead of HTTP dates; we could use X-If-Unmodified-Since or use ETag. I don't believe, but am not sure, that we need to understand the timestamps as a newer/older kind of thing. At least for this case (<tt>last_modified</tt> is different). | ||
'''NOTE:''' using <tt>last_modified</tt> on the client makes us vulnerable to time differences between client and server. We may not really need to use <tt>last_modified</tt> and could just send everything that hasn't been sent, then no local timestamps will be used. | |||
'''NOTE | '''NOTE''' We need to stick with server timestamps ''always'' | ||
=== Deleting the data === | === Deleting the data === |