Closed Bug 1132752 Opened 8 years ago Closed 8 years ago

navigator.syncManager.setPolicy generates DataCloneError


(Core :: DOM: Core & HTML, defect)

Not set



Tracking Status
firefox36 --- wontfix
firefox37 --- wontfix
firefox38 --- fixed
b2g-v2.2 --- fixed
b2g-master --- fixed


(Reporter: jrburke, Assigned: baku)



(1 file, 1 obsolete file)

When using the latest master flashed today on a flame device, which seems to include the fix for bug 1131963 (no more "SetPolicy matches more than 1 task" error), it shows the following error in the logcat when setPolicy is called:

W/GeckoConsole( 1571): [JavaScript Error: "DataCloneError: The object could not be cloned." {file: "resource://gre/modules/RequestSyncService.jsm" line: 810}]

Test app that can be pushed to device via WebIDE:

Set the minInterval secs to another value, and watch the logcat.

Some sync tasks can be generated via this sample app:

The error does not seem to be fatal, the sync task change seems to still take effect, at least according to the data in a subsequent syncManager.registrations() call.
Flags: needinfo?(amarchesini)
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
OS: Mac OS X → All
Hardware: x86 → All
Attached patch rs.patch (obsolete) — Splinter Review
So, here the issue is that we store a nsITimer and a list of requestIDs into an object and then we try to save it into IDB. Before setPolicy() that would actually fine because the operation was done when the timer was null. Now this doesn't work anymore.

With this patch, timers and pending requests are stored in 2 separate maps.
Attachment #8564044 - Flags: review?(fabrice)
Comment on attachment 8564044 [details] [diff] [review]

Review of attachment 8564044 [details] [diff] [review]:

::: dom/requestsync/RequestSyncService.jsm
@@ +925,5 @@
> +    if (!(aObj.dbKey in this._pendingRequests)) {
> +      return [];
> +    }
> +
> +    var requests = this._pendingRequests[aObj.dbKey];

nit: s/var/let
Attachment #8564044 - Flags: review?(fabrice) → review+
Attached patch rs.patchSplinter Review
NOTE: Please see to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 1018320
User impact if declined: RequestSync API will not store tasks correctly into IDB
Testing completed: tbpl
Risk to taking this patch (and alternatives if risky): none
String or UUID changes made by this patch: none
Attachment #8564044 - Attachment is obsolete: true
Attachment #8564072 - Flags: approval-mozilla-b2g37?
Keywords: checkin-needed
Please provide a Try link.
Keywords: checkin-needed
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Attachment #8564072 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
Attachment #8564072 - Flags: approval-mozilla-b2g37+
Comment on attachment 8564072 [details] [diff] [review]

It was already approved to land on b2g37.
Attachment #8564072 - Flags: approval-mozilla-b2g37?
Attachment #8564072 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.