cph-cachet / carp-webservices-spring

REST-based implementation of the CARP Core Domain Model using Spring Boot in Kotlin
https://carp.cachet.dk/
MIT License
3 stars 2 forks source link

GetDataStream end point is throwing strange exception - "Sequence range start lies before the end of a previously appended sequence to the same data stream.", #73

Closed bardram closed 2 months ago

bardram commented 4 months ago

When calling DataStreamServiceRequest.GetDataStream to get a set of data stream, the server throws a strange exception which has nothing to do with getting data (more related to appending data I would think).

So - can't really get any data....

[log] [CAMS DEBUG] REQUEST: https://dev.carp.dk/api/data-stream-service
      {
       "__type": "dk.cachet.carp.data.infrastructure.DataStreamServiceRequest.GetDataStream",
       "apiVersion": "1.1",
       "dataStream": {
        "studyDeploymentId": "04f7c048-c322-4939-a660-be95b0dd3681",
        "deviceRoleName": "Participant's phone",
        "dataType": "dk.cachet.carp.batterystate"
       },
       "fromSequenceId": 0,
       "toSequenceIdInclusive": 100
      }
[log] [CAMS DEBUG] RESPONSE: 400
      {"statusCode":400,"exception":"java.lang.IllegalArgumentException","message":"Sequence range start lies before the end of a previously appended sequence to the same data stream.","path":"POST /api/data-stream-service"}
bardram commented 4 months ago

Make our own CAWSMutableDataStreamBatch implementation of the DataStreamBatch interface that DOES NOT check for all the sequence IDs in the append methods.

davidscavnicky commented 4 months ago

https://github.com/cph-cachet/carp-webservices-spring/pull/77

davidscavnicky commented 4 months ago

the pull request can't merged before we fix:

verify pull requests / build (pull_request) Failing after 35s @xelahalo @yuanchen233 automated checks and build before merged (somehow fails)