docs: update PRD and progress for US-040

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nathan Flurry 2026-03-17 16:52:34 -07:00
parent cd9d71f736
commit 1bd7ef9219
2 changed files with 10 additions and 1 deletions

View file

@ -691,3 +691,12 @@ Started: Tue Mar 17 04:32:06 AM PDT 2026
- `drain(..)` is idiomatic for consuming and clearing a Vec in one step
- Abort tasks BEFORE closing the resource they depend on (CDP client) to avoid race conditions
---
## 2026-03-17 - US-040
- Removed `with_cdp()` method from BrowserRuntime that held the state Mutex across entire CDP round-trips (up to 30s), which could cause deadlocks with background listener tasks
- No callers existed in the codebase; all router handlers already use `get_cdp()` which returns `Arc<CdpClient>` without holding the lock
- Files changed: `browser_runtime.rs`
- **Learnings for future iterations:**
- `get_cdp()` is the canonical pattern for accessing the CDP client - it returns an `Arc<CdpClient>` so callers don't hold the state lock during I/O
- Dead public API methods should be removed proactively to avoid inviting misuse patterns
---