nodejs icon indicating copy to clipboard operation
nodejs copied to clipboard

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

Open lojzatran opened this issue 2 years ago • 1 comments

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.

lojzatran avatar Feb 17 '22 12:02 lojzatran

Hi team, any changes here? Thank you.

lojzatran avatar Sep 14 '22 19:09 lojzatran