commercetools / commercetools/nodejs
[sync-actions] State setTransitions update do not work correctly
- Vorherrschende Sprache
- JavaScript
- Sterne
- 77
- Forks
- 70
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### 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.
Beitragsleitfaden
Rechercherichtung
Beginne am sync-actions-Einstiegspunkt und reproduziere den Fall mit den beiden im Issue gezeigten Transition-Arrays. Prüfe, wie Änderungen an Transitions verglichen werden, bevor setTransitions generiert wird; erledigt bedeutet, dass eine ausschließlich positionsbezogene Änderung keine Update-Aktion erzeugt und den API-Fehler nicht auslöst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, node.js
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100