tiptap collaboration - need number of users or hint if document was already created #2550
Closed
2 tasks done
Labels
Type: Bug
The issue or pullrequest is related to a bug
What’s the bug you are facing?
We are integrating the tiptap collaboration feature using hocuspocus.
We thought it would be the most simple solution if we would just load the document on the client instead of fetching it from the hocuspocus backend.
This would have these advantages:
When opening the document and loading the tiptap editor, the content should be loaded into tiptap on the client side only in one of these two cases:
or
In these cases I would initialize the tiptap editor with the content from a textarea.
In other cases (second person opening the document, document already created on the hocuspocus server) the document would be loaded via the collaboration sync mechanism.
I would now need to know if any other person has authenticated on the hocuspocus server for the same document,
or if the document already exists on the hocuspocus server.
I tried several methods, nothing did work.
How can we reproduce the bug on our side?
First, this is our most simple hocuspocus server config:
And this is the relevant client code for the tiptap editor:
Can you provide a CodeSandbox?
No response
What did you expect to happen?
Maybe I should just hand the document loading to the hocuspocus server.
But our attempt here has the benefit of not needing to load any client extensions,
which the hocuspocus server potentially doesn't know anything about.
Is there a better API of some hocuspocus provider callbacks or events to get notified if a call to
new HocuspocusProvider
initially created the document or to get a relyable number of conected users?Anything to add? (optional)
Sorry for the bug description not really fitting the bug report questions.
Say "nay" and I will update and try to provide a minimal running sandbox.
This is the PR where I develop the collaboration feature: Patternslib/pat-tiptap#6
We are sponsoring tiptap/hocuspocus (pilz, Syslab.com) - I'm part of the Syslab.com team and implementing the tiptap integration.
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: