mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-04 21:17:30 +00:00
With a boolean reentrancy flag, the Task 3 close sequence (`stop(); await sampleOnce()`) returned immediately whenever an interval tick was still awaiting CDP/ps, so getCapturePerfSummary read stats from up to one interval earlier and onSample fired once more after the session had closed. Reproduced with a 350 ms getPids on a 100 ms interval: close resolved with samples=0 and the callback landed afterwards. The guard now keeps the in-flight promise and returns it to any caller, so an interval tick still never stacks a second round-trip (the existing reentrancy test holds) while a close-time call resolves only after the running tick has merged. Deviates from the plan's reference body, which used `let inFlight = false`; the ChromeMemorySampler interface and all names are unchanged, only the sampleOnce() contract is stronger. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>