Skip to content

Commit

Permalink
remove on document removal
Browse files Browse the repository at this point in the history
  • Loading branch information
skhugh committed Jun 12, 2024
1 parent deb893f commit 84c5054
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yorkie/src/main/kotlin/dev/yorkie/core/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public class Client @VisibleForTesting internal constructor(
// be disconnected to not receive an event for that document.
if (document.status == DocumentStatus.Removed) {
attachments.value -= document.key
mutexForDocuments.remove(document.key)
}
}
}.onFailure {
Expand Down Expand Up @@ -561,6 +562,7 @@ public class Client @VisibleForTesting internal constructor(
if (document.status != DocumentStatus.Removed) {
document.status = DocumentStatus.Detached
attachments.value -= document.key
mutexForDocuments.remove(document.key)
}
}
SUCCESS
Expand Down Expand Up @@ -618,6 +620,7 @@ public class Client @VisibleForTesting internal constructor(
val pack = response.changePack.toChangePack()
document.applyChangePack(pack)
attachments.value -= document.key
mutexForDocuments.remove(document.key)
}
SUCCESS
}
Expand Down

0 comments on commit 84c5054

Please sign in to comment.