mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-30 17:32:26 +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]>
8 lines
484 B
Markdown
8 lines
484 B
Markdown
# Decisions
|
|
|
|
## Log
|
|
|
|
- **Bound Relay Concurrency**: Decided to use `pMap` with `RELAY_BACKGROUND_CONCURRENCY = 3` to limit concurrent relay requests during background tasks (history hydration, metadata fetch, DM send).
|
|
- *Rationale*: Unbounded `Promise.all` causes 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.
|