hedgedoc/lib
Julian Rother 2eb4c8e05f Fix premature note cleanup on error
Connection forbidden errors cause cleanup of note state without first
checking if other clients are still connected to the note. This leads
to inconsistent pad content and changes not being saved properly.

This change reverts parts of 725e982 (Fix realtime on forbidden not clean
up properly ...). The call to `interruptConnection()` on permission errors
is redundant, since `failConnection()` and `disconnect()` already perform
all required cleanup in this case. The other call to `interruptConnection()`
only happens when a client (the first client for a note) disconnects while
the note is being loaded from the database. It is refactored for clarity.

Fixes #3894

Co-authored-by: David Mehren <git@herrmehren.de>
Signed-off-by: Julian Rother <julian@jrother.eu>
2023-05-28 16:10:51 +02:00
..
config Allow setting documentMaxLength via CMD_DOCUMENT_MAX_LENGTH 2023-03-09 10:20:42 +01:00
migrations refactor(migrations): move cleanup code into migration 2022-11-06 22:24:48 +01:00
models style(migrations): fix formatting errors 2022-11-06 22:24:48 +01:00
ot Fix logging in ot module 2018-11-13 23:30:13 +01:00
web feat(healthcheck): add /_health endpoint 2023-03-19 22:09:16 +01:00
workers Adapt code for eslint-config-standard 17 2022-05-01 21:19:44 +02:00
csp.js Fix GitLab snippet export 2022-04-10 21:24:30 +02:00
errors.js Fix express deprecation warning 2022-10-30 22:15:16 +01:00
history.js Adapt code for eslint-config-standard 17 2022-05-01 21:19:44 +02:00
letter-avatars.js Use identicons as fallback for libravatar 2022-01-07 14:03:26 +01:00
logger.js Fix eslint warnings 2019-05-31 00:30:29 +02:00
prometheus.js Add custom prometheus metrics 2021-04-25 20:06:56 +02:00
realtime.js Fix premature note cleanup on error 2023-05-28 16:10:51 +02:00
response.js Adapt code for eslint-config-standard 17 2022-05-01 21:19:44 +02:00
utils.js Exclude /metrics and /status routes from session initialization 2021-07-20 23:56:54 +02:00