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

RESOLVED FIXED

Status

()

Firefox for iOS
Sync
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: rnewman, Assigned: rnewman)

Tracking

unspecified
All
iOS

Firefox Tracking Flags

(fxios+)

Details

Attachments

(1 attachment)

47 bytes, text/x-github-pull-request
sleroux
: review+
Details | Review | Splinter Review
(Assignee)

Description

2 years ago
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)
(Assignee)

Comment 1

2 years ago
I suspect this is getting a 404 response in either upload or download of a client record, and the body isn't JSON.
(Assignee)

Comment 2

2 years ago
What's happening here is we're getting a JSON parse error, which overrides the 404 handler, so we don't log that.
(Assignee)

Comment 3

2 years ago
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
(Assignee)

Comment 4

2 years ago
Created attachment 8647791 [details] [review]
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+
(Assignee)

Comment 6

2 years ago
https://github.com/mozilla/firefox-ios/commit/7e2a58a0eda9afc6bc87afe0b83a32fbfa75cef2
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
tracking-fxios: ? → +
Resolution: --- → FIXED
(Assignee)

Comment 7

2 years ago
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.
(Assignee)

Updated

2 years ago
Blocks: 1194556
(Assignee)

Comment 8

2 years ago
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.