fix: recover plain table row index errors

This commit is contained in:
lucaronin
2026-06-05 22:58:28 +02:00
parent 0053a36b6e
commit 401087a8ef
4 changed files with 21 additions and 2 deletions

View File

@@ -88,6 +88,9 @@ describe('isRecoverableEditorTransformError', () => {
expect(isRecoverableEditorTransformError(new RangeError(
'Index 1 out of range for <tableRow(tableCell(tableParagraph("A")))>',
))).toBe(true)
expect(isRecoverableEditorTransformError(new Error(
'Index 1 out of range for <tableRow(tableCell(tableParagraph("A")))>',
))).toBe(true)
expect(isRecoverableEditorTransformError(new Error(
'Block with ID 6c1c3bb4-e218-4f00-aaf5-40606852d286 not found',
))).toBe(true)
@@ -196,6 +199,13 @@ describe('installRichEditorTransformErrorRecovery', () => {
)
})
it('recovers production table row index transactions reported as plain errors', () => {
expectDocumentRepairRecovery(
new Error('Index 1 out of range for <tableRow(tableCell(tableParagraph("A")))>'),
'table_position_out_of_range',
)
})
it('recovers invalid insertion-depth transactions after note switching and saves', () => {
expectDocumentRepairRecovery(
new RangeError('Inserted content deeper than insertion position'),