Closed Bug 1216002 Opened 9 years ago Closed 9 years ago

JavaScript error: resource://gre/modules/RequestSyncService.jsm, line 228: TypeError: 'continue' called on an object that does not implement interface IDBCursor.

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox42 --- unaffected
firefox43 + fixed
firefox44 + fixed

People

(Reporter: ferjm, Assigned: baku)

References

Details

Attachments

(1 file)

I've seen this error in the logcat while launching B2G desktop.
[Tracking Requested - why for this release]: Broken code in initialization function, so I doubt this class behaves correctly.

So the relevant code looks like this:


217   addRegistration: function(aObj, aCb) {
218     debug('addRegistration');
219 
220     let key = this.principalToKey(aObj.principal);
221     if (!(key in this._registrations)) {
222       this._registrations[key] = {};
223     }
224 
225     this.scheduleTimer(aObj, function() {
226       this._registrations[key][aObj.data.task] = aObj;
227       if (aCb) {
228         aCb();
229       }
230     }.bind(this));
231   },

which means the real bug is in the caller: someone called addRegistration and passed IDBCursor.prototype.continue as the second arg without binding it to the relevant IDBCursor.

At first glance, the relevant caller is http://mxr.mozilla.org/mozilla-central/source/dom/requestsync/RequestSyncService.jsm?rev=f2ae60fdfa6d#104 added in bug 1194978.
Blocks: 1194978
Flags: needinfo?(amarchesini)
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
Attached patch rs.patchSplinter Review
I can also do cursor.continue.bind(this) but I use this approach elsewhere in this file.
Attachment #8675900 - Flags: review?(bzbarsky)
Comment on attachment 8675900 [details] [diff] [review]
rs.patch

r=me.  Or you could do:

  this.addRegistration(cursor.value, cursor.continue.bind(cursor));

either way.
Attachment #8675900 - Flags: review?(bzbarsky) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/9519653b7f2e
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
why is comment 5 tagged "backout"?
Flags: needinfo?(wkocher)
Sorry, accidentally used a not-quite-ready Bugherder branch and it got confused and marked every single thing from that merge as a backout.
Flags: needinfo?(wkocher)
Tracking for 43+ since this seems to have been a regression from bug 1194978. 
baku, do you want to request uplift to 43?
Flags: needinfo?(amarchesini)
Comment on attachment 8675900 [details] [diff] [review]
rs.patch

Approval Request Comment
[Feature/regressing bug #]: RequestSync
[User impact if declined]: a broken API
[Describe test coverage new/current, TreeHerder]: no tests.
[Risks and why]: no risk. The patch changes the scope in the use of a IDBCursor.
[String/UUID change made/needed]: none
Flags: needinfo?(amarchesini)
Attachment #8675900 - Flags: approval-mozilla-aurora?
Comment on attachment 8675900 [details] [diff] [review]
rs.patch

Minor fix to recent API regression, ok on m-c. Please uplift to aurora.
Attachment #8675900 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: