mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
refactor: save ydoc state in the database, so it can be restored easier
By storing the ydoc state in the database we can reconnect lost clients easier and enable offline editing because we continue using the crdt data that has been used by the client before the connection loss. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
4707540237
commit
a826677225
26 changed files with 301 additions and 204 deletions
|
@ -41,8 +41,10 @@ export class RealtimeConnection {
|
|||
this.transporter.on('disconnected', () => {
|
||||
realtimeNote.removeClient(this);
|
||||
});
|
||||
this.yDocSyncAdapter = new YDocSyncServerAdapter(this.transporter);
|
||||
this.yDocSyncAdapter.setYDoc(realtimeNote.getRealtimeDoc());
|
||||
this.yDocSyncAdapter = new YDocSyncServerAdapter(
|
||||
this.transporter,
|
||||
realtimeNote.getRealtimeDoc(),
|
||||
);
|
||||
this.realtimeUserStateAdapter = new RealtimeUserStatusAdapter(
|
||||
this.user?.username ?? null,
|
||||
this.getDisplayName(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue