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>
26 KiB
26 KiB