Compare commits

...
Author SHA1 Message Date
arookieofc f8c372929c chore: fix README formatting for oxfmt check 2026-11-10 13:18:33 +08:00
arookieofc 4568272dc3 fix(boot): ignore ResizeObserver loop also when delivered as an Error (#2468)
WebKit (Tauri on Linux) can report the benign loop notification with
an Error object attached, which bypassed the bare-message guard and
showed a fatal startup dialog. Match on the engine-generated message
instead; no genuine startup failure carries these strings.
2026-11-10 13:10:00 +08:00
3 changed files with 16 additions and 10 deletions

No files matched your search

-2
View File
@@ -76,6 +76,4 @@ the [official plugins](plugins/official). The plugin API is still a preview.
[Apache 2.0](LICENSE). Bundled third-party assets are listed in [`THIRD_PARTY_LICENSES.md`](THIRD_PARTY_LICENSES.md).
<sub>Not affiliated with JetBrains. IntelliJ IDEA is a trademark of JetBrains s.r.o.</sub>
+6 -4
View File
@@ -90,11 +90,13 @@
if (target?.tagName === "SCRIPT" || (target?.tagName === "LINK" && target.rel === "modulepreload")) {
show(`Could not load startup script: ${target.src || target.href}`);
} else if (event.error || event.message) {
// ResizeObserver defers undelivered notifications to the next frame; startup can continue.
// ResizeObserver defers undelivered notifications to the next frame; startup can
// continue. Blink reports the loop as a bare message, WebKit (Tauri on Linux) as an
// Error object — ignore both. No genuine startup failure carries these engine strings.
const message = event.error?.message ?? event.message;
if (
!event.error &&
(event.message === "ResizeObserver loop completed with undelivered notifications." ||
event.message === "ResizeObserver loop limit exceeded")
message === "ResizeObserver loop completed with undelivered notifications." ||
message === "ResizeObserver loop limit exceeded"
)
return;
show(event.error || `${event.message}\n${event.filename || ""}:${event.lineno || 0}:${event.colno || 0}`);
+10 -4
View File
@@ -54,10 +54,16 @@ it.each(resizeObserverMessages)("still times out an unresolved startup after %s"
expect(document.querySelector("textarea")?.value).toContain("Startup did not finish within 30 seconds.");
});
it.each(resizeObserverMessages)("keeps actual errors with the same message fatal: %s", (message) => {
window.dispatchEvent(new ErrorEvent("error", { message, error: new Error(message) }));
expect(document.getElementById("splash")).toBeNull();
expect(document.querySelector("textarea")?.value).toContain(message);
it.each(resizeObserverMessages)("ignores the loop notification delivered as an Error: %s", (message) => {
// WebKit (Tauri on Linux) reports the loop with an Error object; Blink as a bare message.
// No genuine startup failure carries these engine-generated strings.
window.dispatchEvent(new ErrorEvent("error", { message, filename: "tauri://localhost", error: new Error(message) }));
expect(document.getElementById("splash")).not.toBeNull();
expect(document.getElementById("boot-error")).toBeNull();
expect(document.documentElement.dataset.boot).toBeUndefined();
window.dispatchEvent(new Event("openidea:boot-ready"));
vi.advanceTimersByTime(30_000);
expect(document.getElementById("boot-error")).toBeNull();
});
it.each(resizeObserverMessages)("keeps rejections with the same message fatal: %s", (message) => {