Skip to content
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

Add Liveness Mechanism in WatchDocument #940

Open
krapie opened this issue Feb 2, 2025 · 0 comments · May be fixed by #941
Open

Add Liveness Mechanism in WatchDocument #940

krapie opened this issue Feb 2, 2025 · 0 comments · May be fixed by #941
Assignees
Labels
enhancement 🌟 New feature or request

Comments

@krapie
Copy link
Member

krapie commented Feb 2, 2025

Description:

I would like to propose the addition of a liveness mechanism to the WatchDocument feature. The idea is to implement a check that if no events are received for a specific document within 1 minute, the client should re-establish the connection.

Currently, the server's long-lived connection faces a split-brain issue, causing disconnections every minute. By implementing this liveness mechanism, we can avoid unnecessary reconnections during collaborative editing scenarios, while still addressing the issue in situations where editing is done alone.

The proposed logic is that the client would implement a connection re-establishment counter (60 seconds). Upon receiving an event, this counter would reset. If the counter reaches zero, a reconnection will take place. Additionally, we could introduce a mechanism to adjust the counter based on recent events. For instance, if events have been consistently occurring, the counter could decrease, leading to quicker reconnections. Conversely, if events have not been received for some time, the counter could be adjusted to allow for longer intervals (exponential backoff) before reconnection, thus accommodating different editing scenarios.

Why:

This enhancement would provide a more efficient connection management process, reducing unnecessary disconnections during collaborative editing while still ensuring timely reconnections when needed. This could significantly improve the user experience in scenarios involving simultaneous edits as well as solitary edits.

@krapie krapie added the enhancement 🌟 New feature or request label Feb 2, 2025
@krapie krapie linked a pull request Feb 2, 2025 that will close this issue
2 tasks
@krapie krapie self-assigned this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

1 participant