Repository navigation
fix: apply each update an upload streams back once, with a synchronous event listener - #7721
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryPrevents upload updates from running again on later download progress events.
Both earlier, unnumbered findings are addressed: rejected promises now have coverage, and the news entry describes the user-visible fix. Reviews (4) · Last reviewed commit: "Merge branch 'main' into fix/upload-chun..." · Reviewed by Greptile |
Merging this PR will degrade performance by 4.16%1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Fixes #7720.
uploadFilescounted a streamed chunk as processed in a.then()on what the socket's"event"listener returned. Since #6827 that listener is synchronous and returnsundefined, so the.thenthrew after the update was applied, the chunk was never counted, and every later download progress event applied all updates received so far again.This PR:
tests/units/reflex_base/client_upload.mjsloads the realupload.jsand streams three updates over three progress events, the last one split across two of them. A synchronous listener handled them as 1, 1, 2, 1, 2, 3 before and 1, 2, 3 now; an async listener, like the one before #6827, handles them once with and without the fix; and a listener that throws or rejects its promise is reported once and its update not retried.