Releases: carp-dk/carp.core-kotlin
Version 1.2.1
This release only impacts the JavaScript/TypeScript release:
- Fixed "unknown polymorphic" serialization for JS released sources (#473).
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.2.0
This release helps implementing infrastructures (specifically CAWS) to implement web-based studies with anonymous participant invites. The underlying mechanism to do so is not different from "username" identification/authentication of users. The username simply needs to be an anonymous ID generated by the infrastructure, and the infrastructure can pass the username/password to the user using their preferred mechanism (e.g., embedded in a one-time link).
These changes require no database migration. If a relational database was used to store AccountIdentity (instead of a document store simply storing the serialized JSON), you may need to add support to store UsernameAccountIdentity, although this type was already defined before this release.
In addition, improvements to JavaScript sources and TypeScript declarations:
- API is now packaged as ES modules (#456)
- Export of kotlin's
Nullable(#445) - Provide access to base properties of snapshots (#457)
Dependency updates:
- Kotlin 1.9.23
- kotlinx.serialization 1.6.3
- coroutines 1.8.0
- datetime 0.5.0
Subsystem changes
Common
- Added
Websiteprimary device (#465)
Studies
- Added
RecruitmentService.AddParticipant()overload which accepts users that are identified by a username (#467). The existingAddParticipantrequest object was renamed toAddParticipantByEmailand the new method was added asAddParticipantByUsername.
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.1.2
This release contains no functional API changes. The main reason for release is a bugfix:
But, there are some major changes which help out infrastructure implementers:
- Backend: Decorator functionality for all application services to apply crosscutting concerns on all requests. E.g., logging, authorization, etc. See types extending from
ApplicationServiceDecorator. - Frontend: JS/TypeScript sources have received a major overhaul.
- They now rely on the new Kotlin JS backend. This means that the sources are not backwards compatible with sources of past releases.
- TypeScript declarations are now available for most types in the application namespace. Ugly "name mangled" interfaces have been replaced with clean facades published as separate packages.
- The packages are now generated as scoped npm packages in a
@cachetscope. - Packages still aren't published to npm, but will be manually attached to releases for now.
Dependency updates:
- Kotlin 1.8.21
- kotlinx.serialization 1.5.0
- coroutines 1.7.0
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.1.1
The main reason for this release is to upgrade to Kotlin 1.8.0, which also allows updating other dependencies. Since 1.6.10, no upgrade was possible due to compiler bugs which have been fixed in 1.8.0.
This release contains no major new features, hence the patch version bump. However, it does introduce a small AnyDeviceConfiguration.isPrimary() helper method.
Dependency updates:
- Kotlin 1.8.0
- kotlinx.serialization 1.4.1
- coroutines 1.6.4
- datetime 0.4.0
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.1.0
The main reason for this release, although it contains various new features, is to be able to handle concurrency issues when an infrastructure using CARP core is set up to allow parallel incoming application service requests.
... infrastructures using CARP core can now verify on repository writes whether the version of the snapshots in the DB match those of the expected
fromSnapshotVersionfrom the [aggregate root (AR)] which is loaded in memory and on which edits were performed. If not, this means a concurrent incoming requests manipulated the same AR, and an exception can be thrown. This exception can be handled uniformly by retrying the whole request.
This requires a database migration!
Subsystem changes
Common
isValidMeasurementcan now be called on mergedDataTypeMetaDataMap, which is useful if you have types defined in addition toCarpDataTypesin your ownDataTypeMetaDataMap(#393)- Support handling concurrent repository updates. Repository writes can now verify whether the version of the snapshot being written matches that which is present in the DB. If not, this means another request simultaneously modified the same object. We recommend implementing a custom exception for this with an associated retry strategy which tries to replay the full application service request. (#402)
- New sensor data types:
- For sensors which can be configured using a sampling interval (
IntervalSamplingScheme), support configuring a fixed set of valid options (#407) - If device-specific data is needed on sensor data (e.g., calibration data used to derive the reported
EDAvalues), it can now be passed using thesensorSpecificDatafield (#411)
Studies
- Fix: ensure that
RecruitmentService.inviteNewParticipantGroupdoes not send out invitations when repository update fails. This supports replaying this request in case of concurrent repository writes, which in this release can now be verified. (#403)
Deployments
- Fix: failing
DeploymentServicerequests after callingunregisterDevice(#406) - Fix: redeploying devices (when unregistering and re-registering them) failed (#413)
Clients
- When using
ClientManager, prevent having to cast toDeploymentStatusAvailablewhenStudyStatusisRunning(#400)
Database migration
A version field was added to Snapshot. This should be set to 0 when migrating the database. The affected snapshots are:
StudySnapshot, including the containingprotocolSnapshotif the value is non-null.StudyDeploymentSnapshot, including the containingstudyProtocolSnapshot.ParticipantGroupSnapshotStudyProtocolSnapshotRecruitmentSnapshot, including the containingstudyProtocolif the value is non-null.
Additionally, the StagedParticipantGroup.invitedOn field was removed, and a isDeployed field was added. The isDeployed field should be set to true. Concretely, when using a document store and CARP's JSON serialization, all values of RecruitmentSnapshot.participantGroups need to:
- remove the
invitedOnfield - add a
isDeployed: truefield
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0
The first stable release of CARP core. The backend application services have been stabilized, and migration functionality is included so that older clients will still be able to call newer backends of the same major API level.
In addition, participants are now invited using participant roles, which dictate which devices they will be assigned to, and which data they are expected to input. This impacts various objects that previously held assigned device role names. (#373) For the majority of studies that only contain a single participant role, no roles need to be specified, and AssignedTo.All can be used to have the same behavior as in older versions.
Dependency updates:
- kotlinx.serialization 1.3.2
- coroutines 1.6.0
Common
- Big rename:
TaskDescriptortoTaskConfigurationTriggertoTriggerConfiguration- Consistently use
statusListfor plural ofstatus(#359)
- Removed
FreeFormText. This was a catch-all solution for extensibility, which was already possible by implementing customDataTypes. - Functionality to migrate incoming API requests to the runtime version (#367):
- Each application service has a matching
ApplicationServiceApiMigrator. - Call
migrateRequestfor incoming JSON requests, which can be old versions, to retrieve aMigratedRequestwhich holds the runtime version inrequest. - Call
MigratedRequest.invokeOnto call the application service and return the JSON response in the version expected by the caller.
- Each application service has a matching
- Add
ACCELERATION, including gravity, toSmartphone. (#369) Usernameserialized as string primitive in JSON, rather than object (only used inUsernameAccountIdentity).- Renamed
RRIntervaltoInterbeatInterval, which is more general since not all interbeat intervals need to be based on RR peaks (4083b64).
Protocols
- Optional participant roles can be defined in
StudyProtocol, and devices can be assigned to participant roles. By default, devices are assigned to "all" roles, meaning all participants in case no roles are specified. (#373) - Expected participant data now includes an optional participant role the
ParticipantAttributeapplies to. The equivalent of the old behavior is usingAssignedTo.All, in which case the data can be edited by all participants in the deployment. When assigning data to one or more specific participant roles, the data can be set per role.
Deployments
- Expected participant data is now included in
PrimaryDeviceDeployment, so that clients have access to the necessary meta data to determine validity of data. ParticipationService.setParticipantDatanow includes ainputByParticipantRoleparameter to set data assigned to a specific participant role.
Studies
- Added
StudyService.RemoveProtocol. (#360) - Added
studyProtocolIdtoStudyStatus, which isnulluntil study protocol is set. (#365) RecruitmentService.inviteNewParticipantGroupnow usesAssignedParticipantRolesrather thanAssignParticipantDevices.StudyService.setInternalDescriptioncan now setdescriptiontonullto indicate no description is set (it isnullto start out with).
Data
DataStreamService.removeDataStreamsreturns IDs of study deployments for which data streams were removed.- Removed
DataTimeType.EITHER: all data points in a data stream sequence should bePOINTorTIME_SPAN, but not a mix of the two. - Timestamps in sequences are now validated (#366):
POINT: start time of subsequent points should always be > last pointTIME_SPAN: end time should be > last end time; start time >= last start time
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.39
The last release prior to a stable 1.0 release. This includes the start of some big renaming, and preparations for API stabilization.
- JSON schemas: Starting from this release, you can find JSON schemas for all application service requests and responses under the
rpc/schemasfolder. In addition, example requests and responses will be added as an asset to the release. (#351) - Versioned API: application service request objects and integration events now carry an
apiVersionwith amajorandminorcomponent. Within major versions, minor versions will be backwards compatible. Helper classes will be provided by core to perform the necessary migrations. (#354, #357)
Dependency updates:
- Kotlin 1.6.10
- kotlinx.serialization 1.3.1
Common
- All
AggregateRoots now have anid; no more custom IDs. IntegrationEventnow carries anaggregateId; implementing infrastructures need to guarantee ordering for all events sharing the sameaggregateId. (#338)- Only lowercase and alphanumerics are allowed in
NamespacedId. (#340) - Added an optional
displayNametoDeviceRegistrationwhich front-ends can use to render concise information about registered devices without worrying about concrete types. (#350) - Big rename:
$typediscriminator in JSON has been replaced with__typeMasterDeviceDescriptortoPrimaryDeviceConfigurationMasterDeviceDeploymenttoPrimaryDeviceDeploymentDeviceDescriptortoDeviceConfiguration- as well as all related names and references to them, e.g.,
assignedPrimaryDeviceRoleNames
Protocols
- #346 Study names still need to be unique to study owners.
- Replaced
ProtocolOwnerwithUUID. (#343) - Renamed
ProtocolService.getAllFortogetAllForOwner.
Deployments
StudyDeploymentsRemovedevent now only carries a singlestudyDeploymentId, so removing multiple deployments fires multiple events.- Renamed
DeploymentRepository.getStudyByrenamed togetStudyByDeployment.
Studies
- Replaced
StudyOwnerwithUUID. (#343)
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.38
Common/Protocols
-
Data type changes (#331):
Accelerationrenamed toNonGravitationalAccelerationand should hold SI unit (m/s^2) excluding gravity instead of g force.- Added
AngularVelocity. - Both
AccelerationandAngularVelocitywere added toSmartphone.Sensors.
-
For known supported data stream data types on
DeviceDescriptor, the sampling configuration is now validated (#312). -
Devices can now be configured to be optional, using
DeviceDescriptor.isOptional(#323). -
Various new TypeScript declarations to access members of
StudyProtocolSnapshot, including devices, tasks, and triggers.
Studies
Various changes related to managing participant group life cycle (#314):
- Added
StagedParticipantGrouptoRecruitmentdomain object to store participant groups that aren't necessarily deployed yet. But, this functionality is not exposed in application service yet. ParticipantGroupStatusis turned into a state machine with statesStaged,Invited,Running, andStopped.Invitedcontains aninvitedOnfield, andStoppedastoppedOnfield.RecruitmentService.deployParticipantGrouprenamed toinviteNewParticipantGroup.
Deployments
- Renamed
StudyDeploymentStatus.DeploymentReadytoRunning. - Renamed
MasterDeviceDeployment.configurationtoregistration. - Renamed
DeploymentService.deploymentSuccessfultodeviceDeployed. - Include assigned device roles in
StudyDeploymentStatus.participantsStatus, as the new typeParticipantStatuswhich in the future will also hold information on consent, etc. (#329).
Clients
Cleaner API to obtain default sampling configurations (#318):
DeviceDescriptor.getDefaultSamplingConfiguration()moved toRuntimeDeviceInfo.defaultSamplingConfiguration.RuntimeDeviceInfocan be retrieved throughMasterDeviceDeployment.getRuntimeDeviceInfo().- Updated documentation for client implementations which sampling configuration to use at runtime.
Major rework of client API, in line with DDD principles (#321):
- Main API, accessed through
ClientManagerhas been moved to theapplicationnamespace. StudyRuntimeis split intoStudyandStudyDeploymentProxy.Studystate is represented inStudyStatus, representing the state based on incoming study deployment events.ClientManager.addStudy()no longer callstryDeployment(). You can thus add a study without trying to deploy it, at which point it will be in theDeploymentNotStartedstate.
Data
- The data subsystem now accepts data types for which no corresponding
Dataobject is available at runtime (#334). - Completed tasks should be uploaded using
CompletedTask. - Better defined
SyncPointbehavior and helper methods (#333).
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.28.5 (hotfix)
Applies six hotfixes to version 1.0.0-alpha.28:
- Bugfix:
ProtocolVersion.dateshould always be serialized. - Bugfix: load
classDiscriminatorfor unkown polymorphism at runtime. - Fallback to normal polymorphic serialization for non-Json formats in
UnknownPolymorphicSerializers. - Make sure
ParticipantGroupSnapshotcan be serialized as BSON. - Devices can now be optional, specified as an
isOptionalproperty onDeviceDescriptor. Now, only non-optional master devices need to be deployed. Only non-optional master devices need to be deployed. (cherry-picked from #323) - Add assigned device role names in
DeanonymizedParticipation. After having calledParticipantService.deployParticipantGroup()it was impossible to retrieve which devices were assigned to participants. A different solution to this was implemented on the main branch, includingParticipantStatusinStudyDeploymentStatus, but given the amount of changes since alpha 28, aligning this API would introduce many more breaking changes rather than this rather simplistic hotfix.
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.28.4 (hotfix)
Applies five hotfixes to version 1.0.0-alpha.28:
- Bugfix:
ProtocolVersion.dateshould always be serialized. - Bugfix: load
classDiscriminatorfor unkown polymorphism at runtime. - Fallback to normal polymorphic serialization for non-Json formats in
UnknownPolymorphicSerializers. - Make sure
ParticipantGroupSnapshotcan be serialized as BSON. - Devices can now be optional, specified as an
isOptionalproperty onDeviceDescriptor. Now, only non-optional master devices need to be deployed. Only non-optional master devices need to be deployed. (cherry-picked from #323)
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp