[history-ot] initial implementation of using doc-level history-ot (#25054)

* [history-v1-ot] initial implementation of using doc-level history-v1-ot

* [web] fix advancing of the otMigrationStage

Use 'nextStage' for the user provided, desired stage when advancing.

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [document-updater] document size check in editor-core

* [history-ot] rename history-v1-ot to history-ot and add types

* [history-ot] apply review feedback

- remove extra !!
- merge variable assignment when processing diff-match-match output
- add helper function for getting docstore lines view of StringFileData

Co-authored-by: Alf Eaton <alf.eaton@overleaf.com>

* Revert "[document-updater] add safe rollback point for history-ot (#25283)"

This reverts commit d7230dd14a379a27d2c6ab03a006463a18979d06

Signed-off-by: Jakob Ackermann <jakob.ackermann@overleaf.com>

---------

Signed-off-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
Co-authored-by: Alf Eaton <alf.eaton@overleaf.com>
GitOrigin-RevId: 89c497782adb0427635d50d02263d6f535b12481
This commit is contained in:
Jakob Ackermann
2025-05-07 12:53:12 +02:00
committed by Copybot
parent 4d93187e58
commit e8b5ee2ff9
48 changed files with 1828 additions and 223 deletions
@@ -26,6 +26,7 @@ describe('HttpController', function () {
this.Metrics.Timer.prototype.done = sinon.stub()
this.project_id = 'project-id-123'
this.projectHistoryId = '123'
this.doc_id = 'doc-id-123'
this.source = 'editor'
this.next = sinon.stub()
@@ -65,7 +66,9 @@ describe('HttpController', function () {
this.version,
[],
this.ranges,
this.pathname
this.pathname,
this.projectHistoryId,
'sharejs-text-ot'
)
this.HttpController.getDoc(this.req, this.res, this.next)
})
@@ -77,17 +80,16 @@ describe('HttpController', function () {
})
it('should return the doc as JSON', function () {
this.res.json
.calledWith({
id: this.doc_id,
lines: this.lines,
version: this.version,
ops: [],
ranges: this.ranges,
pathname: this.pathname,
ttlInS: 42,
})
.should.equal(true)
this.res.json.should.have.been.calledWith({
id: this.doc_id,
lines: this.lines,
version: this.version,
ops: [],
ranges: this.ranges,
pathname: this.pathname,
ttlInS: 42,
type: 'sharejs-text-ot',
})
})
it('should log the request', function () {
@@ -115,7 +117,9 @@ describe('HttpController', function () {
this.version,
this.ops,
this.ranges,
this.pathname
this.pathname,
this.projectHistoryId,
'sharejs-text-ot'
)
this.req.query = { fromVersion: `${this.fromVersion}` }
this.HttpController.getDoc(this.req, this.res, this.next)
@@ -128,17 +132,16 @@ describe('HttpController', function () {
})
it('should return the doc as JSON', function () {
this.res.json
.calledWith({
id: this.doc_id,
lines: this.lines,
version: this.version,
ops: this.ops,
ranges: this.ranges,
pathname: this.pathname,
ttlInS: 42,
})
.should.equal(true)
this.res.json.should.have.been.calledWith({
id: this.doc_id,
lines: this.lines,
version: this.version,
ops: this.ops,
ranges: this.ranges,
pathname: this.pathname,
ttlInS: 42,
type: 'sharejs-text-ot',
})
})
it('should log the request', function () {