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

RESOLVED FIXED in Firefox 43

Status

()

defect
RESOLVED FIXED
4 years ago
2 months ago

People

(Reporter: ferjm, Assigned: baku)

Tracking

unspecified
mozilla44
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox42 unaffected, firefox43+ fixed, firefox44+ fixed)

Details

Attachments

(1 attachment)

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

Updated

4 years ago
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
Assignee

Comment 2

4 years ago
Posted 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+
Assignee

Updated

4 years ago
Keywords: checkin-needed

Comment 5

4 years ago
bugherdermerge
https://hg.mozilla.org/mozilla-central/rev/9519653b7f2e
Status: NEW → RESOLVED
Last Resolved: 4 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)
Assignee

Comment 9

4 years ago
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
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.