plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

HTTP: cancelling request not working for streaming

Open egoist opened this issue 8 months ago • 1 comments

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

egoist avatar Mar 21 '25 15:03 egoist

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

amrbashir avatar Mar 22 '25 08:03 amrbashir