Add event when the connection lost modal is shown for users who have internet, but doc saves aren't successful (#25960)

* adding naive event send for case where realtime is disconnected, but user has internet connection for events

* using reportError and moving ops length summation to getUnsavedOpsSize

GitOrigin-RevId: 7c1c8e31ddbaa21fbc299703c69cf07ab46df925
This commit is contained in:
Jimmy Domagala-Tang
2025-08-06 08:05:34 +00:00
committed by Copybot
parent d7b282c176
commit dcd73f16a6
2 changed files with 29 additions and 1 deletions
@@ -41,6 +41,22 @@ export class OpenDocuments {
return this.openDocs.get(docId)
}
getUnsavedOpsSize() {
const docs = this.unsavedDocs()
let pendingOpsLength = 0
let inflightOpsLength = 0
for (const doc of docs) {
const pendingOp = doc.getPendingOp()
const inFlightOp = doc.getInflightOp()
pendingOpsLength += pendingOp?.length || 0
inflightOpsLength += inFlightOp?.length || 0
}
return {
pendingOpsLength,
inflightOpsLength,
}
}
private createDoc(docId: string) {
const doc = new DocumentContainer(
docId,