plugins-workspace
plugins-workspace copied to clipboard
HTTP: cancelling request not working for streaming
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
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