Closed Bug 993468 Opened 10 years ago Closed 10 years ago

TypeError: callback is undefined in jsonSave()

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31
Tracking Status
firefox30 --- unaffected
firefox31 + fixed

People

(Reporter: whimboo, Assigned: rvitillo)

References

Details

(Keywords: regression)

Attachments

(1 file, 3 obsolete files)

With a current debug build built after todays Nightly I get the following exceptions thrown in the console:

Full message: TypeError: callback is undefined
Full stack: this.Utils.jsonSave<@resource://services-sync/util.js:397:5
TaskImpl_run@resource://gre/modules/Task.jsm:282:1
Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:748:11
this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:627:7
waitForSyncCallback@resource://services-common/async.js:99:7
Res__request@resource://services-sync/resource.js:389:7
Res_post@resource://services-sync/resource.js:427:5
SyncEngine.prototype._uploadOutgoing/doUpload<@resource://services-sync/engines.js:1382:1
innerBind@resource://services-sync/util.js:531:35
SyncEngine.prototype._uploadOutgoing@resource://services-sync/engines.js:1430:9
SyncEngine.prototype._sync@resource://services-sync/engines.js:1481:7
WrappedNotify@resource://services-sync/util.js:141:1
Engine.prototype.sync@resource://services-sync/engines.js:655:5
_syncEngine@resource://services-sync/stages/enginesync.js:199:7
sync@resource://services-sync/stages/enginesync.js:149:13
onNotify@resource://services-sync/service.js:1247:7
WrappedNotify@resource://services-sync/util.js:141:1
WrappedLock@resource://services-sync/util.js:96:9
_lockedSync@resource://services-sync/service.js:1241:1
sync/<@resource://services-sync/service.js:1232:7
WrappedCatch@resource://services-sync/util.js:70:9
sync@resource://services-sync/service.js:1220:5
TPS__Sync@resource://tps/tps.jsm:854:5
TPS.RunNextTestAction@resource://tps/tps.jsm:552:7
TPS.RunNextTestAction@resource://tps/tps.jsm:564:5

Looks like a regression from bug 988301.
Assignee: nobody → rvitillo
Attachment #8403387 - Attachment is obsolete: true
Attachment #8403387 - Flags: review?(rnewman)
Attachment #8403395 - Flags: review?(rnewman)
Comment on attachment 8403395 [details] [diff] [review]
TypeError: callback is undefined in jsonSave(), v1

Review of attachment 8403395 [details] [diff] [review]:
-----------------------------------------------------------------

I'd prefer you go a step further with this: pass a callback in the failing call site, so we have the opportunity to log on error!
Attachment #8403395 - Flags: review?(rnewman) → feedback+
Attachment #8403395 - Attachment is obsolete: true
Attachment #8404669 - Flags: review?(rnewman)
Comment on attachment 8404669 [details] [diff] [review]
TypeError: callback is undefined in jsonSave(), v2

Review of attachment 8404669 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with correction.

::: services/sync/modules/engines.js
@@ +750,5 @@
>  
>    get toFetch() this._toFetch,
>    set toFetch(val) {
> +    function cb(error) {
> +      this._log.error(Utils.exceptionStr(error));

This is wrong. `this` is the function object.

Try:

  let cb = (error) => this._log.error(Utils.exceptionStr(error));

@@ +776,5 @@
>    get previousFailed() this._previousFailed,
>    set previousFailed(val) {
> +    function cb(error) {
> +      this._log.error(Utils.exceptionStr(error));
> +    }

Same.
Attachment #8404669 - Flags: review?(rnewman) → review+
(In reply to Richard Newman [:rnewman] from comment #5)
> This is wrong. `this` is the function object.
> 
> Try:
> 
>   let cb = (error) => this._log.error(Utils.exceptionStr(error));

Why not directly defining it inline?
(In reply to Henrik Skupin (:whimboo) from comment #6)

> Why not directly defining it inline?

No reason not to, unless you're bothered by long lines. Also no real reason to do so. 0fg.
https://hg.mozilla.org/integration/fx-team/rev/6d956b7f8f6e
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/6d956b7f8f6e
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla31
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.