Skip to content

runtime: 本地暂停状态与 CDP 不一致时以 CDP 为准并退化求值 - #12

Merged
taisuii merged 1 commit into
mainfrom
fix/paused-reconcile
Nov 2, 2026
Merged

taisuii merged 1 commit into
mainfrom
fix/paused-reconcile

Conversation

@taisuii

@taisuii taisuii commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

本地 isPaused 与 CDP 真实状态会分叉,disable/enable 之后尤其常见。此前遇到「Can only perform operation while paused」直接抛错,把整条求值路径堵死。

现在捕获这类错误后按 CDP 修正本地状态,再退化为页面求值,而不是让一次状态错位变成不可恢复的失败。

改动文件:\src/service.mjs\、\src/vendor/core-build/src/{DebuggerContext.js,tools/debugger.js,tools/script.js}\,新增 \ ests/paused-reconcile.test.js\。

验证:
ode --test --test-concurrency=2 test/*.test.mjs\ → 36 通过 / 0 失败 / 1 跳过(跳过的是 Windows 符号链接权限那条,环境限制)。

本地 isPaused 与 CDP 真实状态会分叉,disable/enable 之后尤其常见。
此前遇到「Can only perform operation while paused」直接抛错,把整条求值路径堵死。

现在捕获这类错误后按 CDP 修正本地状态,再退化为页面求值,
而不是让一次状态错位变成不可恢复的失败。

配套 paused-reconcile 测试覆盖状态对账。
@taisuii
taisuii merged commit ff2b3f7 into main Nov 2, 2026
4 checks passed
@taisuii
taisuii deleted the fix/paused-reconcile branch November 2, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant