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 .
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)
Assignee: nobody → mhammond
Status: NEW → ASSIGNED
Iteration: --- → 40.1 - 13 Apr
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 #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
Comment on attachment 8588931 [details] [diff] [review] 0004-Bug-1149896-avoid-warnings-when-using-sendAsyncMessa.patch Should be in 38 beta 3
You need to log in before you can comment on or make changes to this bug.