hocuspocus icon indicating copy to clipboard operation
hocuspocus copied to clipboard

v3 - WIP

Open janthurau opened this issue 1 year ago • 1 comments

goals:

  • ⏳ Separate connection / provider more, make it more easy and remove weird hacks that were added to keep BC with v1
  • ✅ Separate Hocuspocus server / handler logic
  • subdocs support
  • fix other breaking issues (#606)
  • maybe we can implement reauthentication (not sure what's needed there ; maybe the provider can just re-send the info, but I think the server needs to be adjusted to handle the incoming message type)
  • maybe we can finally upgrade ioredis (https://github.com/ueberdosis/hocuspocus/pull/580)
  • https://github.com/ueberdosis/hocuspocus/issues/596
  • https://github.com/ueberdosis/hocuspocus/issues/594
  • ... (more to come)

janthurau avatar Jan 04 '24 11:01 janthurau

Consider using the api Y.diffUpdate, we don't need to load ydoc into memory.

Here is the simulation syncstep1 and syncstep2 code:

if messageYjsSyncStep1
    cli_sv = decode(cli_msg)
    srv_state = load(name)

    diff = Y.diffUpdate(srv_state, cli_sv);
    send(writeSyncStep2(diff))

    srv_sv = Y.encodeStateVectorFromUpdate(srv_state)
    send(writeFirstSyncStep(srv_sv))

else if messageYjsSyncStep2
    update = decode(msg)
    srv.persist(update)

......

solirpa avatar Jan 10 '24 07:01 solirpa