#15996 closed defect (fixed)
Adding a progback causes returned promise to be resolved when progress is emitted
Reported by: | Mark Wubben | Owned by: | Mark Wubben |
---|---|---|---|
Priority: | blocker | Milestone: | 1.8.1 |
Component: | Core | Version: | 1.8.0 |
Keywords: | Cc: | bforbes | |
Blocked By: | Blocking: |
Description
signalListener
in dojo/Deferred
unexpectedly resolves the promise's internal deferred when a progback function is available.
var dfd = new Deferred(); var p = dfd.then(null, null, function(){}); dfd.progress(); // p.isFulfilled() --> true
Given that I found this myself I suppose not many people are using progress updates…
Change History (7)
comment:1 Changed 10 years ago by
Milestone: | tbd → 1.8.1 |
---|---|
Owner: | set to Mark Wubben |
Status: | new → assigned |
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
Priority: | undecided → blocker |
---|
comment:4 Changed 10 years ago by
Cc: | bforbes added |
---|
Bryan, would you be my review buddy on promise code? :-)
Note: See
TracTickets for help on using
tickets.
There's a patch at <https://github.com/novemberborn/dojo/commit/8f626cc419338c4bd0477039213453f09d987e4f>.
The patch comes with a small feature change: if the progback returns a value (that is not undefined), a new progress update is emitted on the returned promise. This makes it possible to propagate progress updates through a promise chain without having to explicitly break the change with other deferreds. Given that nobody else has found this bug before I think this is unlikely to break existing code.