You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[http] Aborting a streaming response doesn't close the connection while the server is silent #3713
Calling AbortController.abort() or reader.cancel() on a plugin fetch response doesn't close the HTTP connection while a body read is waiting for data. The connection closes only when the server sends another byte; if the server stays silent, it never closes until the app exits. The server is therefore not told the client has gone, e.g. for server-sent events or LLM token streams.
First seen on 2.5.8; still present on 2.8.3 (latest).
Reproduction
A Tauri 2.12.3 app with only tauri-plugin-http 2.8.3 and @tauri-apps/plugin-http 2.8.3. Capability:
import{fetch}from'@tauri-apps/plugin-http';constac=newAbortController();constreader=(awaitfetch('http://127.0.0.1:47587/',{signal: ac.signal})).body.getReader();awaitreader.read();// first chunkreader.read();// pending read, as a streaming client hasconsole.log(Date.now(),'abort');ac.abort();// same result with reader.cancel()
Expected behavior
The server logs client closed immediately after abort, as it does when the same page uses the webview's own fetch.
Actual behavior
Time from abort() (or reader.cancel()) to the server seeing the connection close:
Server after the first chunk
Webview's own fetch
Plugin fetch
Stays silent
3–14 ms
Never (closes when the app exits)
Sends a chunk every 600 ms
~4 ms
~450 ms: only when the next chunk arrives
Node 24 fetch and curl against the same server close within 4 ms, so the server detects closes correctly.
Activity
fix(http): interrupt pending body reads on cancellation (fix tauri-ap…