mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Replaces unbounded `Promise.all(relays.map(...))` calls with `pMap` using a concurrency limit of 3 for background operations like history hydration, metadata fetching, and DM sending. This prevents network saturation and potential main-thread jank when many relays are configured. Includes benchmark verification script `benchmarks/relay_concurrency_repro.mjs`. Audited upload docs and confirmed accuracy. Co-authored-by: PR0M3TH3AN <[email protected]>
484 B
484 B
Decisions
Log
- Bound Relay Concurrency: Decided to use
pMapwithRELAY_BACKGROUND_CONCURRENCY = 3to limit concurrent relay requests during background tasks (history hydration, metadata fetch, DM send).- Rationale: Unbounded
Promise.allcauses network congestion and can freeze the UI if many relays are configured. 3 is a conservative default. - Alternative: Could have used a global queue, but per-operation concurrency is simpler and sufficient for now.
- Rationale: Unbounded