cph-cachet / carp.core-kotlin

Infrastructure-agnostic framework for distributed data collection.
https://carp.cachet.dk/core/
MIT License
21 stars 3 forks source link

Add deployment warning on invalid expected participant data #476

Open Whathecode opened 7 months ago

Whathecode commented 7 months ago

Currently, it is possible to add a protocol with invalid DefaultParticipantAttributes. E.g.,

"attribute": {
        "__type": "dk.cachet.carp.common.application.users.ParticipantAttribute.DefaultParticipantAttribute",
        "inputDataType": "some.type"
      }

As stated elsewhere:

The protocol service does not validate inputDataType. Only when setting the participant data on ParticipationService, errors will occur if no type information is available for the provided inputDataType.

It will be useful to fail early, upon creation of the study protocol in the studies subsystem. This can likely be done by adding a new item to possibleDeploymentIssues.

When considering whether this should be a warning or an error, I believe it should most likely be a warning, keeping flexibility of deploying different versions of CARP subsystems in mind. It can be that the deployment backend has a more recent version than the studies frontend, in which case it could handle study protocols with inputDataType's which are only known on the backend, but not available to the frontend runtime.