Skip to content

Commit 5d1c3fc

Browse files
chaxusclaude
andcommitted
fix(v9): report an open-conversion failure once (the vendor leaves two promises unhandled); harden the open-failure dialog assertion for CI
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 29ddccf commit 5d1c3fc

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎lib/onlyoffice-editor.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ function installOpenFailureGuard(win: Window): void {
386386
}
387387
return;
388388
}
389+
// The vendor's async loadDocument leaves both the inner conversion
390+
// promise and its own promise unhandled, so this fires twice per
391+
// failure; report once.
392+
if (documentOpenError) return;
389393
console.error('[OO] open conversion failed:', message);
390394
markDocumentOpenFailed(message);
391395
const api = w.Asc?.editor;

‎test/e2e/open-failure.spec.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ test.describe('open failure surfacing (real editor)', () => {
3636

3737
// The SDK error path ran: the vendor's own open-error dialog is up ...
3838
const editorFrame = page.frameLocator('iframe').frameLocator('iframe[name="frameEditor"]');
39-
await expect(editorFrame.locator('.asc-window.modal.alert')).toContainText(/error has occurred while opening/i, {
40-
timeout: 60_000,
41-
});
39+
await expect(
40+
editorFrame.locator('.asc-window.modal.alert', { hasText: /error has occurred while opening/i }).first(),
41+
).toBeVisible({ timeout: 60_000 });
4242
// ... and the "Loading spreadsheet" mask is gone instead of spinning forever.
4343
await expect(editorFrame.locator('.asc-loadmask')).toHaveCount(0, { timeout: 15_000 });
4444

0 commit comments

Comments
 (0)