Files
hedgedoc-hedgeagent/public/docs
Erik Michelson da2c065e59 fix(realtime): check for online users before clearing note
The disconnect handler for the realtime connection checks whether the
disconnecting socket was the last user for that note. If that's the
case and the note had unsaved changes, it persists them to the database
which is an async progress. In the callback of this async progress, the
note and all its pending changes (should be empty) are deleted.
However, when the user reconnects quickly because of a flaky
connection, it could happen that they create new pending changes before
the database saving finished. As there was no additional "no-users"
check before clearing the note, this could lead to content loss.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-08-21 13:22:17 +02:00
..
2020-07-10 18:57:59 +02:00