Skip to content

Incorrect data in callback react-native-blob-util@0.22.1 #420

@szujak

Description

@szujak

Hello,

After upgrading to 0.22.1 I noticed that there is an issue with returning data from ReactNativeBlobUtil.df on windows.

I'm calling this method const availableDiskSpace = await ReactNativeBlobUtil.fs.df(); but instead of information about storage the error is thrown with message {"code":"EUNSPECIFIED"}

After checking the df method code I noticed that on windows the storage info is populated in err argument

function df(): Promise<{ free: number, total: number }> {
    return new Promise((resolve, reject) => {
        ReactNativeBlobUtil.df((err, stat) => {
            console.log(err, stat) // the err argument contains [{"free": 123, "total": 1234}] and stat is undefined
            if (err)
                reject(addCode('EUNSPECIFIED', new Error(err)));
            else
                resolve(stat);
        });
    });
}

Calling the same method on android works fine - err is null and stat contains storage info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions