-
Notifications
You must be signed in to change notification settings - Fork 416
🐛(frontend) fix initial content with collaboration #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e86b157 to
1feb271
Compare
1feb271 to
4204eff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work, though I think it's a bit cleaner to do this on the server, so there's 1 place responsible for creating a new document (both the metadata and the document data), and initialDoc would always be set.
Having said that, I do think this approach should work, there might be a small bug with two headings appearing if 2 users open a new document at the same time, but this is very unlikely
Yes but the server is in python, and we are a SPA, so we cannot use |
|
@YousefED Hi youseff, Do you think it is possible to add an "editor is ready" event to avoid timeouts and to perform actions on the editor when we are sure that it is possible? |
The way the initial content was created was causing issues with the collaboration server. As soon a user started typing, the problem was gone. This commit fixes that by letting Blocknote managing the initial content, then we update the Blocknote initial content with our initial content.
|
We'll make it so that you can immediately call updateBlock (without a
timeout or event). I have this on a dev branch already, I'll let you know
once it's merged (might be a few weeks, so until that time I think a
timeout is ok)
…On Wed, Dec 11, 2024 at 3:22 PM Nathan Panchout ***@***.***> wrote:
@YousefED <https://github.com/YousefED> Hi youseff, Do you think it is
possible to add an "editor is ready" event to avoid timeouts and to perform
actions on the editor when we are sure that it is possible?
—
Reply to this email directly, view it on GitHub
<#484 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC2BWI2WDPTK6A7A2ICEXT2FBDDJAVCNFSM6AAAAABTHRCIJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZWGEZTSNBRGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Nice. We will have the possibility soon to create it from the server as well. |
4204eff to
37d772b
Compare
Purpose
The initial document creation could create bug with collaboration. As soon as a char was enter and saved, this bug stopped to appear (basically after 1 mn).
The initial creation involving collaboration seems more complicated that what we were doing:
https://github.com/TypeCellOS/BlockNote/blob/71792c2fbdc99785cd8ce5b540d1a468e6c66131/packages/core/src/editor/BlockNoteTipTapEditor.ts#L73-L131
Proposal
We will let Blocknote managing the initial creation, and we will update the Blocknote initial creation with our initial creation.
Collaborating issue are gone, the document sync correctly between collaborators.