Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

RequestControlAction returns three items #138

Closed
aggelosgkiokas opened this issue Feb 18, 2021 · 2 comments · Fixed by #140
Closed

RequestControlAction returns three items #138

aggelosgkiokas opened this issue Feb 18, 2021 · 2 comments · Fixed by #140
Labels
bug Something isn't working

Comments

@aggelosgkiokas
Copy link

To reproduce in the api-test:

query {
  ControlAction(
    filter: {
      actionStatus: PotentialActionStatus
      wasDerivedFrom_in: [
        { identifier: "8346b126-2954-43e7-aab1-87f1420063b9" }
        { identifier: "b3ae5c61-7812-494e-8730-66194a3bee98" }
        { identifier: "40157358-8fe5-4385-9e59-1c3efc6ca1a8" }
        { identifier: "6b340d52-bb5b-4a17-a518-4f9463bf223d" }
        { identifier: "d0374f80-bdbd-4412-9b96-dfb6c405a6ee" }
        { identifier: "0cd06dea-c64d-4d73-849b-5bda7002c872" }
      ]
    }
  ) {
    identifier
    description
    actionStatus
    wasDerivedFrom{
      identifier
    }
  }
}

Result:


{
  "data": {
    "ControlAction": []
  }
}

Then:


mutation {
  RequestControlAction(
    controlAction: {
      potentialActionIdentifier: "6b340d52-bb5b-4a17-a518-4f9463bf223d"
      entryPointIdentifier: "5337c151-07a3-46bd-a6de-0c631c55a185"
      propertyObject: [
        {
          nodeIdentifier: "60dedbf9-6f95-4028-8e96-91e4e0f81f56"
          potentialActionPropertyIdentifier: "f11db864-df31-417b-b4d6-7d41ac325f47"
          nodeType: DigitalDocument
        }
        {
          nodeIdentifier: "b6d351f0-f051-44b7-aa35-6cf93510314c"
          potentialActionPropertyIdentifier: "c66fb618-4685-485d-a8e6-de5d254cafc9"
          nodeType: DigitalDocument
        }
      ]
      propertyValueObject: [
        {
          value: "1"
          potentialActionPropertyValueSpecificationIdentifier: "6b392265-63ea-4b34-9cb0-ddc5b9c897d5"
          valuePattern: String
        }
        {
          value: "28"
          potentialActionPropertyValueSpecificationIdentifier: "00a754b1-6c85-495c-9be1-a8e9acd3b1b5"
          valuePattern: String
        }
        {
          value: "0.460487499990472"
          potentialActionPropertyValueSpecificationIdentifier: "2b7b0cb7-6163-4f28-bf78-99317d484e07"
          valuePattern: String
        }
        {
          value: "Soprano"
          potentialActionPropertyValueSpecificationIdentifier: "e705ba5e-1a20-4d33-a9e8-b2fc239e5452"
          valuePattern: String
        }
        {
          value: "100"
          potentialActionPropertyValueSpecificationIdentifier: "d02402e4-f51f-4fb4-948a-69e40c721121"
          valuePattern: String
        }
      ]
    }
  ) {
    identifier
  }
}

Result:

{
  "data": {
    "RequestControlAction": {
      "identifier": "1a4671ef-6fa9-4920-9a42-38a70443edb7"
    }
  }
}

If we query again:

query {
  ControlAction(
    filter: {
      actionStatus: PotentialActionStatus
      wasDerivedFrom_in: [
        { identifier: "8346b126-2954-43e7-aab1-87f1420063b9" }
        { identifier: "b3ae5c61-7812-494e-8730-66194a3bee98" }
        { identifier: "40157358-8fe5-4385-9e59-1c3efc6ca1a8" }
        { identifier: "6b340d52-bb5b-4a17-a518-4f9463bf223d" }
        { identifier: "d0374f80-bdbd-4412-9b96-dfb6c405a6ee" }
        { identifier: "0cd06dea-c64d-4d73-849b-5bda7002c872" }
      ]
    }
  ) {
    identifier
    description
    actionStatus
    wasDerivedFrom{
      identifier
    }
  }
}

We get three results

{
  "data": {
    "ControlAction": [
      {
        "identifier": "1a4671ef-6fa9-4920-9a42-38a70443edb7",
        "description": "Singing Performance Assessment",
        "actionStatus": "PotentialActionStatus",
        "wasDerivedFrom": [
          {
            "identifier": "6b340d52-bb5b-4a17-a518-4f9463bf223d"
          }
        ]
      },
      {
        "identifier": "0d40a6ec-fdf0-43b1-82f4-028a038642a5",
        "description": "Singing Performance Assessment",
        "actionStatus": "PotentialActionStatus",
        "wasDerivedFrom": [
          {
            "identifier": "6b340d52-bb5b-4a17-a518-4f9463bf223d"
          }
        ]
      },
      {
        "identifier": "3902c002-f457-4b62-8a61-5eb944f454a9",
        "description": "Singing Performance Assessment",
        "actionStatus": "PotentialActionStatus",
        "wasDerivedFrom": [
          {
            "identifier": "6b340d52-bb5b-4a17-a518-4f9463bf223d"
          }
        ]
      }
    ]
  }
}
@aggelosgkiokas aggelosgkiokas added the bug Something isn't working label Feb 18, 2021
@alastair
Copy link
Member

Have you double-checked this with an empty CE? The fact that their are exactly 3 control actions is a bit suspicious, and I think that it could be because we accidentally created additional links between some objects that shouldn't be there.
Can you provide a full set of queries (or tpl config file) to create the SoftwareApplication/EntryPoint/ControlAction nodes too?

@alastair
Copy link
Member

We tested this a bit more and in an empty CE it doesn't cause the same problem. It's not clear to us if we incorrectly linked some objects in the test CE which are causing more than 1 item to be returned in the join query in the RequestControlAction mutation, or if it's incorrectly matching on a different field.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants