Closed
Bug 793037
Opened 13 years ago
Closed 8 years ago
Missing test coverage for negative timestamps
Categories
(Cloud Services Graveyard :: Server: Sync, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: rfkelly, Assigned: rfkelly)
Details
Android sync appears to use "X-If-Unmodified-Since: -0.001" in some of its requests. Whatever it is trying to do, it works fine against our server but fails against a third-party reimplementation (https://github.com/posativ/weave-minimal/)
There is no test in our functional testsuite that can pinpoint the difference. It will need to be something like this:
def test_ifunmodifiedsince_on_nonexistent_collection(self):
wbos = [{'id': 'TEST', 'payload': _PLD}]
self.app.get(self.root + '/storage/NONEXISTENT')
self.app.post_json(self.root + '/storage/NONEXISTENT', wbos,
headers=[('X-If-Unmodified-Since', '-0.001')],
status=200)
self.app.post_json(self.root + '/storage/NONEXISTENT', wbos,
headers=[('X-If-Unmodified-Since', '-0.001')],
status=412)
But that passes on both server-full and weave-minimal, so there must be something more to it.
| Assignee | ||
Comment 1•13 years ago
|
||
Original reported says "I use the latest Firefox from F-Droid on Nexus 7". The request in question is:
Authorization: Basic foobar=
Content-Length: 302
User-Agent: Firefox AndroidSync 0.9 (Firefox)
Connection: close
X-If-Unmodified-Since: -0.001
X-Script-Name: /weave
Host: posativ.org
X-Scheme: https
X-Forwarded-For: 86.56.27.137
Content-Type: application/json
127.0.0.1 - - [21/Sep/2012 01:09:03] "POST /weave/1.1/dbxv2a5gbfgkdkhvbv6xnoebmt2dkye2/storage/clients HTTP/1.0" 412 -
| Assignee | ||
Comment 2•13 years ago
|
||
cc'ing :rnewman, please explain how android sync uses this header value when operating on the clients collection, and I'll draft a testcase to match.
Comment 3•13 years ago
|
||
This is probably a FP rounding error. It could also be due to the server at some point in the past returning -0.001 as the modified time of the clients collection!
I'd rule that out, first.
And it shouldn't occur:
public String ifUnmodifiedSince() {
Long timestampInMilliseconds = currentlyUploadingRecordTimestamp;
// It's the first upload so we don't care about X-If-Unmodified-Since.
if (timestampInMilliseconds <= 0) {
return null;
}
return Utils.millisecondsToDecimalSecondsString(timestampInMilliseconds);
}
The problem is occurring in uploading a client record; possibly our own, possibly after sending a tab. Would need to see a debug log from Android first.
Here's the debug log: http://paste.posativ.org/nbw
I removed the existing sync account and paired this device again. I wonder, why info/collections is different to the actual return value:
$ curl -u dbxv2a5gbfgkdkhvbv6xnoebmt2dkye2:password https://posativ.org/weave/1.1/dbxv2a5gbfgkdkhvbv6xnoebmt2dkye2/info/collections
{"passwords": 1348173081.78, "addons": 1348162758.79, "tabs": 1348217477.35, "clients": 1348162754.07, "crypto": 1346775310.72, "forms": 1348180975.48, "meta": 1346775366.2, "bookmarks": 1348153343.75, "prefs": 1346776525.68, "history": 1348217477.28}
| Assignee | ||
Comment 5•8 years ago
|
||
This is 6 years old and we haven't encountered is with sync1.5, so I'm going to go ahead and close it out.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Updated•3 years ago
|
Product: Cloud Services → Cloud Services Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•