Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNFetchBlob.session(...).remove(path) not removing path from session list #885

Open
varemel opened this issue Dec 3, 2024 · 0 comments
Open

Comments

@varemel
Copy link

varemel commented Dec 3, 2024

Hello,

Thanks for your cool lib. I am really enjoing using it.

Found bug with session remove method. It doesn't remove item from list.

i will be item (=path string) and not index of element. This code will never find item to delete, because list[i] will always be undefined.

for(let i of list) {

  remove(path:string):RNFetchBlobSession {
    let list = sessions[this.name]
    for(let i of list) {
      if(list[i] === path) {
        sessions[this.name].splice(i, 1)
        break;
      }
    }
    return this
  }

Suggest fix

  remove(path:string):ReactNativeBlobUtilSession {
    let list = sessions[this.name];
    for (let i = 0; i < list.length; i++) {
      if (list[i] === path) {
        sessions[this.name].splice(i, 1);
        break;
      }
    }
    return this;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant