mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[clsi] address zod violations (#36199)
* [editor-core] gracefully handle no-op TextOperation * [web] avoid sending sync to pdf requests without a ?file * [validation-tools] log deeper nested violations * [editor-core] fix round trip of EditNoOperation * [web] use custom error for sync to pdf w/o file, fix tests * [validation-tools] include request params in log msg for violation * Revert "[editor-core] gracefully handle no-op TextOperation" This reverts commit c1d37261d5db72b37dbf39428c54edcfb5423f41. * [web] gracefully handle rejected sync to pdf from context menu GitOrigin-RevId: 21de7dc96b23575b0d67b6eb0c68ed9c2f86292b
This commit is contained in:
@@ -35,7 +35,8 @@ class Operation {
|
||||
if (
|
||||
'textOperation' in raw ||
|
||||
'commentId' in raw ||
|
||||
'deleteComment' in raw
|
||||
'deleteComment' in raw ||
|
||||
'noOp' in raw
|
||||
) {
|
||||
return EditFileOperation.fromRaw(raw)
|
||||
}
|
||||
|
||||
@@ -78,4 +78,18 @@ describe('EditFileOperation', function () {
|
||||
expect(editFileOperation1).to.deep.equal(edit('foo.tex', ['x']))
|
||||
})
|
||||
})
|
||||
|
||||
describe('fromRaw / toRaw', function () {
|
||||
it('round-trips an edit no-op', function () {
|
||||
const editFileOperation = Operation.editFile(
|
||||
'foo.tex',
|
||||
EditOperationBuilder.fromJSON({ noOp: true })
|
||||
)
|
||||
const raw = editFileOperation.toRaw()
|
||||
expect(raw).to.eql({ pathname: 'foo.tex', noOp: true })
|
||||
|
||||
const roundTripped = Operation.fromRaw(raw)
|
||||
expect(roundTripped).to.deep.equal(editFileOperation)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user