Increase the length of unsaved doc time before the editor is locked (#23431)

* Use opInflightSince to measure unsaved doc time
* Use performance.now() for lastAcked timestamp
* Use inflightOpCreatedAt
* Increase MAX_UNSAVED_ALERT_SECONDS to 15
* Increase MAX_UNSAVED_SECONDS to 30
* Increase FATAL_OP_TIMEOUT to 45000
* Convert "Connection lost" modal to a notification

GitOrigin-RevId: 2d4233723620fd03ce6d6c5795c48c33c0b2f92c
This commit is contained in:
Alf Eaton
2025-02-20 09:05:20 +00:00
committed by Copybot
parent 04a2e24a89
commit f40118e58b
10 changed files with 98 additions and 56 deletions
@@ -182,6 +182,10 @@ export class DocumentContainer extends EventEmitter {
return this.doc?.getRecentAck()
}
getInflightOpCreatedAt() {
return this.doc?.getInflightOpCreatedAt()
}
hasBufferedOps() {
return this.doc?.hasBufferedOps()
}
@@ -354,7 +358,7 @@ export class DocumentContainer extends EventEmitter {
pendingOpSize < MAX_PENDING_OP_SIZE
) {
// There is an op waiting to go to server but it is small and
// within the flushDelay, this is OK for now.
// within the recent ack limit, this is OK for now.
saved = true
debugConsole.log(
'[pollSavedStatus] pending op (small with recent ack) assume ok',