Fix HAR capture missing API requests under heavy traffic (#1135)

The CDP event broadcast buffer (256 events) was too small for pages with
many concurrent API requests, causing silent event drops. Modern SPAs
routinely fire 100+ API calls during page load, generating 300+ CDP
network events that would overflow the buffer between drain cycles.

Changes:
- Increase CDP broadcast buffer from 256 to 4096 (event channel) and
  512 to 4096 (raw channel)
- Reduce background drain interval from 500ms to 100ms
- Handle Network.loadingFailed events in HAR recording
- Enable Network.enable on cross-origin iframe sessions during HAR
  recording and request tracking
- Allow Network events from iframe sessions through the session filter
- Log a warning when buffer overflow occurs instead of silently dropping

Fixes #1128

Co-authored-by: ctate <366502+ctate@users.noreply.github.com>
This commit is contained in:
Chris Tate
2026-04-04 10:25:12 -05:00
committed by GitHub
co-authored by ctate
parent 0a36666587
commit c52d25d576
3 changed files with 59 additions and 5 deletions
+2 -2
View File
@@ -87,8 +87,8 @@ impl CdpClient {
let ws_tx = Arc::new(Mutex::new(ws_tx));
let pending: PendingMap = Arc::new(Mutex::new(HashMap::new()));
let (event_tx, _) = broadcast::channel(256);
let (raw_tx, _) = broadcast::channel(512);
let (event_tx, _) = broadcast::channel(4096);
let (raw_tx, _) = broadcast::channel(4096);
let pending_clone = pending.clone();
let event_tx_clone = event_tx.clone();