mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-27 02:43:29 -04:00
The CDP timeout handler in httpLoop had two compounding bugs: 1. Unit mismatch: timestamp(.monotonic) returns seconds, but ms_remaining is in milliseconds. The comparison and subtraction mixed units. 2. Double-counting: In the .done branch, elapsed was computed as absolute time since last_message, but last_message was never updated in this branch. Each iteration subtracted the growing total elapsed seconds from an already-decremented ms_remaining. During complex page loads, Session._wait() returns .done rapidly (due to JS macrotask execution, background tasks, or errors). Each rapid .done return subtracted the growing elapsed (seconds) from ms_remaining (milliseconds), draining it to zero in ~2 seconds instead of the configured 10-second timeout. Fix: use milliTimestamp() for consistent units, update last_message in the .done branch for incremental elapsed tracking, and use >= for correct boundary comparison. Fixes #1849 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 KiB
29 KiB