Skip to content

Conversation

@juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Mar 13, 2024

This fix may help with duplicate content of documents.

While staring at code and reading yjs/yjs-demos#16 I noticed we may have a race condition where two browsers would attempt to create a new document, while that is catched the session receiving the unique constraint exception would still continue with the freshSession value set to true and handing over the file content and using that to initialize the document again locally.

@juliusknorr juliusknorr added bug Something isn't working 3. to review labels Mar 13, 2024
@juliusknorr juliusknorr mentioned this pull request Mar 13, 2024
Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me 👌

@juliusknorr juliusknorr merged commit e2ad77e into main Mar 13, 2024
@juliusknorr juliusknorr deleted the fix/duplicate-document-init-race branch March 13, 2024 16:22
@juliusknorr
Copy link
Member Author

/backport to stable28

@juliusknorr
Copy link
Member Author

/backport to stable27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants