Skip to content

Commit

Permalink
Revert "encapsulate Document"
Browse files Browse the repository at this point in the history
This reverts commit 9a2e440.
  • Loading branch information
7hong13 committed May 28, 2024
1 parent 286eca6 commit 8febcf6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions yorkie/src/main/kotlin/dev/yorkie/core/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public class Client @VisibleForTesting internal constructor(
return@async SUCCESS
}

document.setStatus(DocumentStatus.Attached)
document.status = DocumentStatus.Attached
attachments.value += document.key to Attachment(
document,
response.documentId,
Expand Down Expand Up @@ -535,7 +535,7 @@ public class Client @VisibleForTesting internal constructor(
val pack = response.changePack.toChangePack()
document.applyChangePack(pack)
if (document.status != DocumentStatus.Removed) {
document.setStatus(DocumentStatus.Detached)
document.status = DocumentStatus.Detached
attachments.value -= document.key
}
SUCCESS
Expand Down
6 changes: 1 addition & 5 deletions yorkie/src/main/kotlin/dev/yorkie/document/Document.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class Document(

@Volatile
public var status = DocumentStatus.Detached
private set
internal set

@VisibleForTesting
public val garbageLength: Int
Expand Down Expand Up @@ -451,10 +451,6 @@ public class Document(
onlineClients.value -= actorID
}

internal fun setStatus(newStatus: DocumentStatus) {
this.status = newStatus
}

/**
* Deletes elements that were removed before the given time.
*/
Expand Down

0 comments on commit 8febcf6

Please sign in to comment.