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
Upload responses are re-applied on every download progress event since #6827 #7720
An upload handler's response is streamed back as newline-delimited updates, and uploadFiles (utils/helpers/upload.js) hands each one to the socket's "event" listener as it arrives. It only counts a chunk as processed in a .then() on what the listener returns:
event_callbacks.map((f,ix)=>{f(chunk).then(()=>{if(ix===event_callbacks.length-1){// Mark this chunk as processed.resp_idx+=1;}})
Since #6827 the listener in state.js is no longer async and returns undefined, so f(chunk).then throws a TypeError right after the update was applied. The surrounding try swallows it and only logs it, as "Error parsing chunk", when the download progress is 1. resp_idx stays 0, so every later progress event of the upload applies every update received so far again: an upload that streams 3 updates over 3 progress events applies them as 1, 1, 2, 1, 2, 3.
Besides the wasted work, a re-applied update overwrites any newer value that arrived over the socket in between with its older one, until the upload's own updates replace it again.
To reproduce, stream updates from an upload handler that take a moment each:
Each later progress event dispatches the earlier deltas again (visible with a breakpoint in the "event" listener, or with React DevTools' highlight updates).
Activity
linear-code commentedon Nov 2, 2026
ENG-13676