Closed Bug 1194499 Opened 8 years ago Closed 8 years ago

Partial JSON responses muffle NotFound errors; command sends fail on 404

Categories

(Firefox for iOS :: Sync, defect)

All
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios + ---

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

Attachments

(1 file)

47 bytes, text/x-github-pull-request
sleroux
: review+
Details | Review
2015-08-13 13:39:50.042 [Debug] [ClientsSynchronizer.swift:223] maybeUploadOurRecord(_:ifUnmodifiedSince:toServer:): Client record upload succeeded. New timestamp: 1439498389960.
2015-08-13 13:39:50.045 [Info] [SQLiteRemoteClientsAndTabs.swift:335] getCommands(): Found 1 client sync commands in the DB.
2015-08-13 13:39:50.107 [Error] [StorageClient.swift:311] errorWrap(_:handler:): Got error Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x174473480 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}. Response: Optional(404)
I suspect this is getting a 404 response in either upload or download of a client record, and the body isn't JSON.
What's happening here is we're getting a JSON parse error, which overrides the 404 handler, so we don't log that.
This breaks command sending to other clients, and also tab sync (which depends on clients).
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
tracking-fxios: --- → ?
Summary: Malformed JSON… somewhere → Partial JSON responses muffle NotFound errors; command sends fail on 404
Attached file Pull req.
Attachment #8647791 - Flags: review?(sleroux)
Comment on attachment 8647791 [details] [review]
Pull req.

Code looks good - just some q's
Attachment #8647791 - Flags: review?(sleroux) → review+
https://github.com/mozilla/firefox-ios/commit/7e2a58a0eda9afc6bc87afe0b83a32fbfa75cef2
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Half way there:

2015-08-13 18:35:04.809 [Debug] [ClientsSynchronizer.swift:239] maybeUploadOurRecord(_:ifUnmodifiedSince:toServer:): Should we upload our client record? Caller = false, expired = false.
2015-08-13 18:35:04.811 [Info] [SQLiteRemoteClientsAndTabs.swift:335] getCommands(): Found 1 client sync commands in the DB.
2015-08-13 18:35:04.813 [Debug] [ClientsSynchronizer.swift:193] syncClientCommands(_:commands:clientsAndTabs:withServer:): Fetching current client record for client Tb40VvFMTUfh.
2015-08-13 18:35:04.874 [Debug] [StorageClient.swift:326] errorWrap(_:handler:): Status code: 404
2015-08-13 18:35:04.875 [Warning] [ClientsSynchronizer.swift:211] syncClientCommands(_:commands:clientsAndTabs:withServer:): Failed to fetch record with GUID Tb40VvFMTUfh.
2015-08-13 18:35:04.875 [Error] [ClientsSynchronizer.swift:226] syncClientCommands(_:commands:clientsAndTabs:withServer:): Client Tb40VvFMTUfh commands upload failed: No remote client for GUID


Now to figure out why the NotFound code block didn't run.
Blocks: 1194556
I pushed 3de233f as a follow-up: I changed my mind on whether to throw away or keep trying on 404.
You need to log in before you can comment on or make changes to this bug.