Skip to content

HTTP: cancelling request not working for streaming #2557

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

Open
egoist opened this issue Mar 21, 2025 · 1 comment · May be fixed by #2562
Open

HTTP: cancelling request not working for streaming #2557

egoist opened this issue Mar 21, 2025 · 1 comment · May be fixed by #2562
Labels
bug Something isn't working plugin: http

Comments

@egoist
Copy link

egoist commented Mar 21, 2025

Once fetch_read_body is fired, aborting the fetch will stop working

https://github.com/tauri-apps/tauri-plugin-http/blob/918e02820d7963030993e902f808ccc7995bd509/guest-js/index.ts#L256

@FabianLars FabianLars added bug Something isn't working plugin: http labels Mar 21, 2025
amrbashir added a commit that referenced this issue Mar 22, 2025
@amrbashir amrbashir linked a pull request Mar 22, 2025 that will close this issue
@amrbashir
Copy link
Member

Could you give #2562 a try and see if there is any use cases I missed?

I mainly tested the following case:

const abort = new AbortController();
const res = await fetch("someurl", { signal: abort.signal })
const reader = res.body.getReader();

reader.read() // ensure we got some data
abort.abort() // abort the requst
reader.read() // fails as the stream is closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin: http
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants