Repository navigation
fix(history): avoid placeholder crashes when loading snapshots - #160
Merged
Merged
Conversation
Signed-off-by: Leo Stehlik <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 previouseditor.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:
Position 16 out of rangeand passes afterwards in Chromium and WebKit.All commits include DCO sign-off. Implemented from WrenLore code and reproduced behaviour; no post-fork Docmost or proprietary source was used.
Deployed at
ca6eb28to the maintainer’s test instance and accepted after live testing. Merged intomasterafter 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.