client-web
client-web copied to clipboard
Reenable import from file on multi-user whiteboards
Description
As an Alkemio user I want to be able to import an exported Excalidraw JSON to my collaborative whiteboard.
Context
With the works performed on whiteboards we have disabled the functionality "LoadScene" from excalidraw that loads an exported JSON file because it was causing synchronization issues on multiuser whiteboards. On single user whiteboards (template editing, whiteboard form fields) the functionality is still available
- Causes: when Excalidraw loads a file, it replaces in memory the entire structure, all the previous elements are gone, so we cannot send a broadcast message to delete them, all the versions of the elements are the versions coming in the file, so sceneVersion gets also problematic.
- Possible fixes:
- An attempt to fix the sceneVersion has been done here: https://github.com/alkem-io/excalidraw-fork/pull/7 but this is not enough
- The elements versions should be updated but also the previous elements should be kept as deleted
- OR:
- we can add a callback to the
<Excalidraw
componentonLoadScene
that can reset from outside all the elements, the scene version, and send a broadcast so every client do the same.
Acceptance criteria
- [ ] Multi user whiteboards don't get desynchronized when one of the clients imports a JSON file
Additional Context
Screen shots / UX designs / data that are relevant.
Areas that will be affected
To be added during the refinement