Closed Bug 1149896 Opened 6 years ago Closed 6 years ago

console reports "Sending message that cannot be cloned. Are you trying to send an XPCOM object?" as reading-list items are added.

Categories

(Firefox Graveyard :: Reading List, defect, P3)

defect

Tracking

(firefox38 fixed, firefox39 fixed, firefox40 fixed)

RESOLVED FIXED
Firefox 40
Tracking Status
firefox38 --- fixed
firefox39 --- fixed
firefox40 --- fixed

People

(Reporter: markh, Assigned: markh)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

The message appears only in the "browser console", and comes from our various:

    let mm = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
    mm.broadcastAsyncMessage("Reader:Added", item);

calls in ReadingList.jsm.  I previously thought that the item could be sent so long as it was JSONifiable - hence we have the this._unserializable() hack in ReadingList.jsm - but it seems I'm wrong :( The solution seems to be to send the record, as per the attachment.

CC Florian and Jaws as they might have more insight into what we can expect to fail given we aren't sending the messages.  I expected the +- button in reader view to not work, but it seems to work fine (and I'm out of time to dig deeper today)
Flags: qe-verify-
Flags: firefox-backlog+
Assignee: nobody → mhammond
Blocks: 1132074
Status: NEW → ASSIGNED
Iteration: --- → 40.1 - 13 Apr
Priority: -- → P3
Duplicate of this bug: 1151640
Ah - https://dxr.mozilla.org/mozilla-central/source/dom/base/nsFrameMessageManager.cpp#599 shows that this message is logged whenever the object can't be cloned, but the code falls-back to JSON - which succeeds in our case. This explains why no failure could be observed - the only problem is the warning.

This patch is similar to the last, but instead of sending item._record we send item.toJSON() - which is identical but avoids direct use of ._record and thus should be more future-proof.
Attachment #8586596 - Attachment is obsolete: true
Attachment #8588931 - Flags: review?(adw)
Attachment #8588931 - Flags: review?(adw) → review+
Comment on attachment 8588931 [details] [diff] [review]
0004-Bug-1149896-avoid-warnings-when-using-sendAsyncMessa.patch

https://hg.mozilla.org/integration/fx-team/rev/fad798bf083f

I think we should take this on the branches too to avoid "spamming" the browser console.

Approval Request Comment
[Feature/regressing bug #]: readinglist
[User impact if declined]: Browser console will report errors using readinglist functionality.
[Describe test coverage new/current, TreeHerder]: Existing tests
[Risks and why]: Very low risk, limited just to readinglist.
[String/UUID change made/needed]: None
Attachment #8588931 - Flags: approval-mozilla-beta?
Attachment #8588931 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/fad798bf083f
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
Comment on attachment 8588931 [details] [diff] [review]
0004-Bug-1149896-avoid-warnings-when-using-sendAsyncMessa.patch

Should be in 38 beta 3
Attachment #8588931 - Flags: approval-mozilla-beta?
Attachment #8588931 - Flags: approval-mozilla-beta+
Attachment #8588931 - Flags: approval-mozilla-aurora?
Attachment #8588931 - Flags: approval-mozilla-aurora+
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.