Skip to content

fix(history): avoid placeholder crashes when loading snapshots - #160

Merged
LeoStehlik merged 1 commit into
masterfrom
fix/history-rendering-158
Nov 21, 2026
Merged

LeoStehlik merged 1 commit into
masterfrom
fix/history-rendering-158

Conversation

@LeoStehlik

@LeoStehlik LeoStehlik commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Opening page history for a snapshot containing empty paragraphs could crash the entire page with RangeError: Position … out of range. The editing-placeholder extension builds decorations while the new document is being applied, but its callback resolves positions against the previous editor.state.doc. The read-only visibility option does not prevent that callback from running, so retrying the same snapshot fails again.

Exclude the placeholder extension from the read-only history editor. The shared editing configuration is unchanged. This is a viewer-only fix: no migration, snapshot rewrite, or content deletion.

Closes #158.

Validation:

  • Reproduced the same exception with local copies of both reported pages; both render after the fix. Their contents are not included in the patch or fixtures.
  • Added a synthetic full-editor regression that fails before the fix with Position 16 out of range and passes afterwards in Chromium and WebKit.
  • The regression checks empty paragraphs, code blocks, nested table/blockquote content, switching between larger and smaller versions, highlighting, reopening, and desktop/short/mobile layouts.
  • Existing history layout/navigation browser checks and client type check pass.
  • Added the full-editor mode to CI and documented it; editor changes now trigger the history workflow too.

All commits include DCO sign-off. Implemented from WrenLore code and reproduced behaviour; no post-fork Docmost or proprietary source was used.

Deployed at ca6eb28 to the maintainer’s test instance and accepted after live testing. Merged into master after all CI checks passed. Health checks passed and all nine checked content/history/identity tables matched before and after the app replacement. Existing database and storage were reused.

@LeoStehlik
LeoStehlik merged commit 69e402e into master Nov 21, 2026
2 checks passed
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.

Page history fails to load for Repo Summary page; retry does not recover

1 participant