-
-
Notifications
You must be signed in to change notification settings - Fork 0
Labels
bugSomething isn't workingSomething isn't working
Description
On Scripture Forge, our users have been reported crashes from Lynx while using the editor.
I have narrowed down the source of the crashes to Lynx not correctly handling the addition of delta ops to the end of a scripture delta document, as demonstrated by the following test:
it('add paragraph at end of document', () => {
const document = new ScriptureDeltaDocument(
'uri',
'scr-delta',
1,
new Delta()
.insert({ chapter: { number: '1', style: 'c' } })
.insert({ verse: { number: '1', style: 'v' } })
.insert('This is a test.', { segment: 'verse_1_1' })
.insert('\n', { para: { style: 'p' } })
.insert({ verse: { number: '2', style: 'v' } })
.insert('This is a test.', { segment: 'verse_1_2' })
.insert('\n', { para: { style: 'p' } }),
);
document.update(
new Delta()
.retain(35)
.insert('section header.', { segment: 's_1' })
.insert('\n', { para: { style: 's' } }),
2,
);
expect(document.children.length).toEqual(4);
const paragraph2 = document.children[2];
expect(paragraph2.getText()).toEqual(`\ufffcThis is a test.\n`);
expect(paragraph2.range).toEqual({ start: { line: 2, character: 0 }, end: { line: 3, character: 0 } });
const paragraph3 = document.children[3];
expect(paragraph3.getText()).toEqual(`section header.\n`);
expect(paragraph3.range).toEqual({ start: { line: 3, character: 0 }, end: { line: 4, character: 0 } });
});See also: https://app.bugsnag.com/sil-international/scripture-forge-v2-plus/errors/6945181b5d860bbd2087fadf
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working