Add interface to stop synchronization while maintaining realtime sync
hackerwins opened this issue · 1 comments
hackerwins commented
What would you like to be added:
Currently, Yorkie has the following synchronization modes:
A. Manual Sync
- Manually handle Document synchronization
- Do not connect to a stream to receive Document events
- Do not add Presence of the Client
await client.attach(doc, { isRealtimeSync: false });
B. Realtime Sync
- Automatically handle Document synchronization
- PushPull Mode: Send local changes to other clients and reflect changes from other clients in the local document
- PushOnly Mode: Send local changes to other clients but do not receive changes from other clients, preventing undoing due to remote changes in IME mode
- Connect to a stream to receive Document events
- Add Client Presence to notify other Clients
await client.attach(doc, {
initialPresence: { color: 'blue', cursor: { x: 0, y: 0 } },
isRealtimeSync: true,
});
Refer to
- Document Editing: https://github.com/yorkie-team/yorkie/blob/main/design/document-editing.md
- PubSub(Event Stream): https://github.com/yorkie-team/yorkie/blob/main/design/pub-sub.md
- Synchronization Mode: https://yorkie.dev/docs/js-sdk#changing-synchronization-setting
Additionally, there is a need for a mode where the user can maintain Realtime Sync(register Presence) but neither send nor receive local changes from other clients.
hackerwins commented
- JS SDK: yorkie-team/yorkie-js-sdk#770
- iOS SDK:
- Android SDK: