EveryListedPageBecomesInteractiveWithoutAnError fails on WebKit when the PDF viewer starts a fetch while it is left

未关闭
#15,604 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@msynk 已经在做这个了。

开始于 2026年12月2日。

评估

这个 Issue 还没有评估数据。

描述

HostE2ETests.EveryListedPageBecomesInteractiveWithoutAnError fails on WebKit in WebAssembly now and then, on both tries, when it leaves the PDF viewer (job 143529478062, v-11.0.0 as released):

/e2e/pdf-viewer: raised an error while it was left (Fetch API cannot load http://localhost:5290/samples/pdf-not-a-pdf.pdf due to access control checks.)

#15565 was the same failure. Its fix excuses this message only for a request the browser reported failing after the navigation away began (cutOff), but in this case the browser reports no request at all.

Cause: WebKit's own behavior. While the navigation away is provisional, WebKit fails any load the page being left starts before it reaches the network (CachedResource::load, "Failed security check -- state is provisional"). CachedResourceLoader::requestResource then turns that synchronous cancellation into an access control error ("Synchronous cancellations are likely due to access control"), which DocumentThreadableLoader logs as "Fetch API cannot load ... due to access control checks". On a slow runner the PDF viewer page is still starting its sample fetches when it is left, sometimes before the navigation request and sometimes after.

Evidence

  • A targeted test holds the next document's response back for 3 s, so the navigation stays provisional, and has the page being left call fetch('/samples/pdf-not-a-pdf.pdf?diag').catch(...):
    • WebKit (run 46936271863): no request event at all; pageerror Fetch API cannot load http://localhost:5290/samples/pdf-not-a-pdf.pdf?diag due to access control checks.; and the page's own handler logs fetch rejected TypeError: Load failed. So the rejection is caught, and the message comes from WebKit, not from an unhandled error in the page. The same fetch on a page that stays loads normally (200).
    • Chromium (run 46936279997): the same fetch during the provisional navigation is requested and resolves 200.
  • Logging every request around the PDF viewer's visit in three full WebKit/wasm runs (46924848553, 46924857191, 46924865823, all passing) shows the viewer starts its two pdf-not-a-pdf.pdf fetches 40 to 550 ms after the test sets off. Those fetches were either cut off in flight ("Load request cancelled", no console error) or finished just before the navigation request. When one starts a little later, the navigation is already provisional, and WebKit refuses it as above.
  • The component is not at fault: BitPdfViewer catches the failed fetch (LoadAsync), and the message appears even for a fetch whose rejection the page handles.

Fix (test only). An error naming a fetch with WebKit's "cannot load ... due to access control checks" is also taken for one cut off when it is raised while the page is being left (after the test set off and before the next page commits) and the browser has reported no request for that address since the test set off. A fetch that failed for real went to the network and was reported, so it is still caught.

Flaky rather than broken: the WebKit/wasm shard holding this test failed in 2 of the last 7 full runs (the nights of 2026-11-30 and 2026-12-02). It passed on 2026-11-28, 2026-12-01, and in the three diagnostic runs above.

主要语言
C#
星标
1.4k
派生
264
平均合并
5 小时 40 分钟
30 天内合并 PR
489

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bitfoundation/bitplatform 的其他 Issue

查看 bitfoundation/bitplatform 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。