Skip to content

lean-prod - Opening previously created Drafts results in "Document not found" error in Editor for some items (LEAN-5747) - #345

Closed
asouqi wants to merge 2 commits into
masterfrom
LEAN-5747
Closed

asouqi wants to merge 2 commits into
masterfrom
LEAN-5747

Conversation

@asouqi

@asouqi asouqi commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

No description provided.

mbetamony and others added 2 commits June 11, 2026 17:47
Copilot AI review requested due to automatic review settings June 11, 2026 19:27
@asouqi asouqi closed this Jun 11, 2026
@asouqi
asouqi deleted the LEAN-5747 branch June 11, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a migration edge case where legacy figcaption data can yield an invalid/unsupported caption structure, which can surface as “Document not found” when opening certain previously-created drafts. It also extends the JATS exporter to optionally include uncited references in the generated <ref-list>.

Changes:

  • Update migration 4.3.34 to synthesize a minimal caption structure when legacy figcaption content is missing.
  • Add a schema test fixture case covering an empty figcaption scenario.
  • Add includeUncitedReferences to JATS export options and a test validating the expanded bibliography output.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/schema/migration/migration-scripts/4.3.34.ts Adjusts how captions are reconstructed from legacy figcaption content during migration.
src/schema/tests/docs.ts Adds a fixture containing an empty figcaption to exercise the migration behavior.
src/jats/exporter/jats-exporter.ts Adds an export option to include uncited bibliography items by passing uncited IDs into citeproc state rebuild.
src/jats/tests/jats-exporter.test.ts Adds test coverage for exporting uncited references when the new option is enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +65 to +81
const foundCaption =
captionNodes.length === 0
? {
type: 'caption',
content: [{ type: 'text_block', attrs: {} }],
attrs: {},
}
: captionNodes.reduce<JSONProsemirrorNode>(
(caption, { content }) => ({
...caption,
content: [
...(caption.content || []),
{ type: 'text_block', content, attrs: {} },
],
}),
{ type: 'caption', content: [], attrs: {} }
)
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.

3 participants