Skip to content

Commit

Permalink
Change comment
Browse files Browse the repository at this point in the history
  • Loading branch information
humdrum committed Jan 4, 2024
1 parent 4f076f2 commit fb8ab2c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Sources/Core/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,10 @@ public actor Client {
self.attachmentMap[docKey]?.isRealtimeSync = isRealtimeSync

if isRealtimeSync {
// NOTE(chacha912): When re-establishing real-time sync, there might have been
// changes while the connection was off. Therefore, syncing needs to be performed
// once. Currently, if syncing is called here, it overlaps with `syncInternal`,
// causing the issue of the response being applied twice. (Ref: issues#603)
// Therefore, we set `remoteChangeEventReceived` to true, allowing syncing to
// occur in `syncInternal`.
self.attachmentMap[docKey]?.remoteChangeEventReceived = true
// NOTE(hackerwins): In manual mode, the client does not receive change events
// from the server. Therefore, we need to set `remoteChangeEventReceived` to true
// to sync the local and remote changes. This has limitations in that unnecessary
// syncs occur if the client and server do not have any changes. self.attachmentMap[docKey]?.remoteChangeEventReceived = true
try self.runWatchLoop(docKey)
} else {
try self.stopWatchLoop(docKey)
Expand Down

0 comments on commit fb8ab2c

Please sign in to comment.