readest/apps
Huang Xin a46043dab9
fix(transfer): coalesce progress updates to stop the render storm (#5015)
READEST-2 (Maximum update depth exceeded) was still firing on 0.11.18 despite the
updateTransferProgress no-op guard, because the guard compared transferSpeed,
which webDownload/webUpload recompute from wall-clock time on every chunk, so it
essentially never matched. Indeterminate downloads (R2/S3 signed URLs without
Content-Length -> total=0) churn per chunk too. webDownload drains the stream
with `while (true) { await reader.read(); onProgress(...) }`, so a buffered
source fires the whole burst in one macrotask and the transfer-store fan-out
(the reader subscribes via useTransferQueue) blows past React's nested-update
limit.

- Add createProgressThrottle (leading + trailing, macrotask trailing edge) and
  route every transfer's progress through it in executeTransfer, capping store
  writes at ~10/sec per transfer; flush the final value on completion, cancel on
  teardown.
- Drop transferSpeed from the store's no-op equality so the guard can fire on
  duplicate/stalled progress.

Adds unit tests for the throttle (burst coalescing, flush, cancel) and the
speed-only no-op.

Fixes READEST-2

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 19:55:59 +02:00
..
readest-app fix(transfer): coalesce progress updates to stop the render storm (#5015) 2026-07-08 19:55:59 +02:00
readest-calibre-plugin feat(calibre): add Readest calibre plugin to push books and metadata (#4918) 2026-07-04 16:40:16 +02:00
readest.koplugin perf(koplugin): defer and cache Library group covers (#4954) (#4974) 2026-07-06 17:55:51 +02:00