Skip to content

[sync-actions] State setTransitions update do not work correctly #1765

Open
@lojzatran

Description

@lojzatran

Description

When I have 2 arrays of transition in State resource:

[
  {
    "typeId": "state",
    "key": "Active"
  },
  {
    "typeId": "state",
    "key": "ReminderSent"
  },
  {
    "typeId": "state",
    "key": "Cancelled"
  },
  {
    "typeId": "state",
    "key": "Paused"
  },
  {
    "typeId": "state",
    "key": "Error"
  }
]
[
  {
    "typeId": "state",
    "key": "Cancelled"
  },
  {
    "typeId": "state",
    "key": "Paused"
  },
  {
    "typeId": "state",
    "key": "Error"
  },
  {
    "typeId": "state",
    "key": "Active"
  },
  {
    "typeId": "state",
    "key": "ReminderSent"
  }
]

This would generate an update action:

[
  {
    "action": "setTransitions",
    "transitions": [
      {
        "typeId": "state",
        "key": "Active"
      },
      {
        "typeId": "state",
        "key": "ReminderSent"
      },
      {
        "typeId": "state",
        "key": "Cancelled"
      },
      {
        "typeId": "state",
        "key": "Paused"
      },
      {
        "typeId": "state",
        "key": "Error"
      }
    ]
  }
]

However, this update action would fail with this error: "statusCode":400,"status":400,"message":"'transitions' has no changes.".

In this case, sync-actions should not generate any update actions, even if the elements in the transition array changed their positions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions