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

Canceled Error? #41

Closed
Kayxue opened this issue Apr 25, 2024 · 2 comments · Fixed by #43
Closed

Canceled Error? #41

Kayxue opened this issue Apr 25, 2024 · 2 comments · Fixed by #43
Labels

Comments

@Kayxue
Copy link

Kayxue commented Apr 25, 2024

I wrote the code below and try to get data from an api repeatedly with interval

import { axios } from "rxjs-axios";
import { map, repeat } from "rxjs";

axios
    .get("",{responseType:"text"})
    .pipe(map(({data}) => data),repeat({delay:5000}))
    .subscribe(data => {
        console.log(data)
    });

First time it successfully got the data, but for the second time it printed out "CanceledError: canceled", what does it mean? It won't send request to the api again?

@JoseLion
Copy link
Owner

@Kayxue, sorry for the late response. Unfortunately, I missed the notification.

Thanks for the report! I was able to reproduce the issue. The problem is that all the requests currently share the same abort signal, so the second request is also marked as canceled when the first observable is torn down. I found a way to create an independent signal for each observable. I'll push a fix shortly and make a new release as soon as possible 🙂

JoseLion added a commit that referenced this issue Jun 23, 2024
JoseLion added a commit that referenced this issue Jun 23, 2024
JoseLion added a commit that referenced this issue Jun 23, 2024
JoseLion added a commit that referenced this issue Jun 23, 2024
JoseLion added a commit that referenced this issue Jun 23, 2024
Copy link

🎉 This issue has been resolved in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants