Skip to content

Commit

Permalink
Remove unused workaround for former serialization bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanchen233 authored and Whathecode committed Sep 30, 2024
1 parent 0eec330 commit 4c78321
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import dk.cachet.carp.common.application.triggers.TriggerConfiguration
import dk.cachet.carp.common.application.users.ExpectedParticipantData
import dk.cachet.carp.common.application.users.hasNoConflicts
import dk.cachet.carp.common.infrastructure.serialization.ApplicationDataSerializer
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import kotlinx.serialization.*
import kotlin.js.JsExport
Expand Down Expand Up @@ -98,14 +97,7 @@ data class PrimaryDeviceDeployment(
* The time when this device deployment was last updated.
* This corresponds to the most recent device registration as part of this device deployment.
*/
val lastUpdatedOn: Instant =
// TODO: Remove this workaround once JS serialization bug is fixed:
// https://github.com/Kotlin/kotlinx.serialization/issues/716
@Suppress( "SENSELESS_COMPARISON" )
if ( connectedDeviceRegistrations == null || registration == null ) Clock.System.now()
else connectedDeviceRegistrations.values.plus( registration )
.maxOf { it.registrationCreatedOn }

val lastUpdatedOn: Instant = (connectedDeviceRegistrations.values + registration).maxOf { it.registrationCreatedOn }

/**
* Get info on the primary device and each of the devices this device needs to connect to relevant at study runtime.
Expand Down

0 comments on commit 4c78321

Please sign in to comment.