Skip to content

🐛(frontend) save edits made while the http fallback carries the document - #11

Open
YousefED wants to merge 5 commits into
devfrom
fix/http-fallback-sync
Open

YousefED wants to merge 5 commits into
devfrom
fix/http-fallback-sync

Conversation

@YousefED

@YousefED YousefED commented Oct 10, 2026 •

Copy link
Copy Markdown

Purpose

Fix the 3 e2e tests that failed on every pull request since the BlockNote preview packages (#2). Before, Playwright stopped after these 3 failures (maxFailures: 3), so more than 130 other tests did not run.

Changes

🐛 Edits were not saved when the websocket is blocked (real bug)

Test: "falls back to http polling when the websocket cannot be opened".

  • BlockNote binds the editor to the Yjs document only after the provider reports that it is synced (provider.synced, or its synced event).
  • When the websocket is blocked, the websocket provider never syncs. The http fallback synced the document, but nothing told the provider. Thus the editor stayed unbound: you could type, but the text never went into the Yjs document. The text was not sent and was not saved.
  • Now the provider reports synced after the first http sync (provider.synced = true in the fallback's sync callback). When the websocket connects again, y-websocket controls synced itself.
  • New unit test in useProviderStore.test.tsx. It fails without the fix.

I found this on the dev instance: with the websocket blocked, the http requests carried only awareness, and the editor's sync plugin had no Yjs type.

✅ Comment menu (test only)

Test: "it checks the comments interactions". BlockNote now renders the comment menu ("Edit comment", "Delete comment") in a portal outside .bn-thread. The test now finds the menu items on the page.

✅ PDF language (test only)

Test: "it injects the correct language attribute into PDF export". The PDF is correct. The Typst export writes /Lang(fr), without a space. The test expected /Lang (fr). It now accepts both.

✅ PDF export regression fixture (test only)

Test: "it exports the doc to PDF and checks regressions". The fixture was made with an older exporter. The Typst export also has the emoji, the interlink icon, the diagram, the formula and the image caption, and it writes spaces where the fixture had tabs. The new fixture is the PDF that CI generated. To make this easy next time, the PDF comparison now attaches the generated PDF to the Playwright report.

⏭️ Version history tests (skipped)

Tests: "it displays the doc versions" and "it restores the doc version". They use the "Version history" dialog, which the BlockNote version history sidebar replaced (#2). Also, the history groups edits by at least 5 minutes, so a test cannot create versions. "it does not display the doc versions if not allowed" still runs.

Not in this PR

  • "it check translations of the slash menu when changing language" still fails, and some slash-menu tests are flaky. The keys that the test types right after it opens a new document are lost. A probable cause: BlockNote binds the editor to the Yjs document only after the provider is synced, and the binding replaces what was typed before. This needs a separate fix.

BlockNote binds the editor to the Yjs document only after the provider
reports that it is synced. When the websocket is blocked, the websocket
provider never syncs. The http fallback synced the document, but the
editor stayed unbound: it accepted text that never reached the document,
so the text was not saved. The provider now reports synced after the
first http sync.

Signed-off-by: yousefed <yousefdardiry@gmail.com>
BlockNote now renders the comment menu in a portal outside the thread,
so the test finds its items on the page. The Typst PDF export writes
the language as /Lang(fr), without a space.

Signed-off-by: yousefed <yousefdardiry@gmail.com>
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 4.23 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/3de59d16/_buildManifest.js 0 B -722 B (removed) 🏆
apps/impress/out/_next/static/194339b4/_buildManifest.js 722 B +722 B (new file) 🆕

compressed-size-action

When a PDF regression test fails because of an intended change, the
report now has the generated PDF. It is the new fixture.

Signed-off-by: yousefed <yousefdardiry@gmail.com>
The BlockNote version history sidebar replaced the "Version history"
dialog that these tests use. The history also groups edits by at least
5 minutes, so a test cannot create versions.

Signed-off-by: yousefed <yousefdardiry@gmail.com>
The fixture was made with an older exporter. The Typst export now also
has the emoji, the interlink icon, the diagram, the formula and the
image caption, and writes spaces where the fixture had tabs. The new
fixture is the PDF that CI generated.

Signed-off-by: yousefed <yousefdardiry@gmail.com>
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