Skip to content

JQ3.0 RC1, Deferred.notify / .progress callback getting the wrong params #3129

@VanPuyveldeKevin

Description

@VanPuyveldeKevin

When calling Deferred.notify([params]) it seems like the progress callback on the given promise ends up in an unexpected (incorrect?) situation.
It's receiving undefined as the first param and the params array object in the second.
Basically ... the 'notifyWith' sig (context, [params]).

I would expect the '.notify([params])' to still behave the same as in 1.x/2.x and give the inline progress callback with the given params.

return _retrieve()
            .then(function (data, textStatus, jqXhr)
            {
                deferred.notify(data, textStatus, jqXhr);
                if (data["@odata.nextLink"])
                {
                }
                else
                {
                    deferred.resolve(data, textStatus, jqXhr);
                    return data;
                }
            })

.then(function (data, textStatus, jqXhr)
    {
        assert.ok(true, "Records created");
        return $a.WebAPI.retrieve();
    })
.progress(function (data, textStatus, jqXhr)
    {
        assert.ok(true, "Retrieved a page");        
    })

The progress callback here gets undefined in 'data' (so no context) and the 'params' object of the notifyWith in the 'textStatus' (with the 3 given params as [0], [1] and [2]).

EDIT (by @mgol): fixed the Markdown for proper code formatting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions