Skip to content

Commit b48beb2

Browse files
chore: Adopt V9 Changes #WPB-18787
* Adjust comments
1 parent 5724315 commit b48beb2

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

lib/src/main/kotlin/com/wire/integrations/jvm/client/BackendClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import io.ktor.client.plugins.websocket.DefaultClientWebSocketSession
3333
import java.util.UUID
3434

3535
interface BackendClient {
36-
fun getCurrentSyncMarker(): UUID?
36+
fun getNotificationSyncMarker(): UUID?
3737

3838
suspend fun connectWebSocket(handleFrames: suspend (DefaultClientWebSocketSession) -> Unit)
3939

lib/src/main/kotlin/com/wire/integrations/jvm/client/BackendClientDemo.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,22 @@ internal class BackendClientDemo(
8181
private var cachedFeatures: FeaturesResponse? = null
8282
private var cachedAccessToken: String? = null
8383
private var cachedDeviceId: String? = null
84-
private var currentSyncMarker: UUID? = null
84+
private var notificationSyncMarker: UUID? = null
8585

86-
override fun getCurrentSyncMarker(): UUID? = currentSyncMarker
86+
override fun getNotificationSyncMarker(): UUID? = notificationSyncMarker
8787

8888
override suspend fun connectWebSocket(
8989
handleFrames: suspend (DefaultClientWebSocketSession) -> Unit
9090
) {
9191
logger.info("Connecting to the webSocket, waiting for events")
9292

93-
currentSyncMarker = UUID.randomUUID()
93+
notificationSyncMarker = UUID.randomUUID()
9494
val token = loginUser()
9595

96-
val url = StringBuilder().apply {
97-
append("/$API_VERSION/events")
98-
append("?client=$cachedDeviceId")
99-
append("&access_token=$token")
100-
append("&sync_marker=$currentSyncMarker")
101-
}.toString()
96+
val url = "/$API_VERSION/events" +
97+
"?client=$cachedDeviceId" +
98+
"&access_token=$token" +
99+
"&sync_marker=$notificationSyncMarker"
102100

103101
httpClient.wss(
104102
host = IsolatedKoinContext.getApiHost()?.replace("https://", "")

lib/src/main/kotlin/com/wire/integrations/jvm/client/BackendClientImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import org.slf4j.LoggerFactory
4848
internal class BackendClientImpl(private val httpClient: HttpClient) : BackendClient {
4949
private val logger = LoggerFactory.getLogger(this::class.java)
5050

51-
override fun getCurrentSyncMarker(): UUID? = null
51+
override fun getNotificationSyncMarker(): UUID? = TODO("Not yet implemented")
5252

5353
override suspend fun connectWebSocket(
5454
handleFrames: suspend (DefaultClientWebSocketSession) -> Unit

lib/src/main/kotlin/com/wire/integrations/jvm/service/WireTeamEventsListener.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ internal class WireTeamEventsListener internal constructor(
100100
val ackRequest = EventAcknowledgeRequest.basicAck(deliveryTag)
101101
ackEvent(ackRequest, session)
102102
}
103-
val currentSyncMarker = backendClient.getCurrentSyncMarker()
104-
if (notification.data.markerId == currentSyncMarker.toString()) {
103+
val notificationSyncMarker = backendClient.getNotificationSyncMarker()
104+
if (notification.data.markerId == notificationSyncMarker.toString()) {
105105
logger.info("Notifications are up to date since last sync marker.")
106106
} else {
107-
logger.debug(
107+
logger.info(
108108
"Skipping sync marker [${notification.data.markerId}], " +
109109
"as it is not valid for this session."
110110
)

0 commit comments

Comments
 (0)