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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user