Skip to content

refreshApex errors if the response is undefined #2207

Open
@rgalanakis

Description

@rgalanakis

Description

This code: refreshApex({data: undefined, error: undefined}) will return undefined rather than a promise. It should return a promise (resolved or rejected, either seems reasonable) to adhere to async conventions.

Steps to Reproduce

Call refreshApex({data: undefined, error: undefined}).then(() => console.log('x')), observe TypeError Cannot read property 'then' of undefined.

Expected Results

No error is thrown (refreshApex returns a promise).

Actual Results

refreshApex returns undefined.

Browsers Affected

All.

Version

Current Salesforce.

Possible Solution

Return Promise.resolve() instead, since this seems like a noop.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions