commercetools / commercetools/nodejs

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

Aperta
#1,765 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Type: Bug
Lingua principale
JavaScript
Stelle
77
Fork
70
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal punto di ingresso di sync-actions e riproduci il caso con i due array di transizioni mostrati nell’issue. Verifica come vengono confrontate le modifiche alle transizioni prima di generare setTransitions; il lavoro è completato quando una modifica esclusivamente posizionale non produce alcuna azione di aggiornamento e non attiva l’errore dell’API.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, node.js
Ambito
api
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.