shoppingflux / shoppingfluxexport

7 stars 7 forks source link

getOrders should not repeat itself when a same token is duplicated in the configuration #413

Open ghost opened 6 years ago

ghost commented 6 years ago

Expected behaviour

Only one call of getOrders should be done for a single token when calling orders.php (or hookbackOfficeTop).

Therefore, it should ne be possible to have duplicated calls of getOrders

Actual behaviour

There are some instances where a same token can wrongly be configured in the multitoken configuration. In which case, when hookbackOfficeTop is called, each token will call a getOrders and therefore duplicated tokens will call twice a getOrders on the same instance.

Steps to reproduce the behaviour

Set up multitoken with duplicated tokens:

General : ABCTEST
English (English) / Dollar : ABCTEST
English (English) / Euro : ABCTEST
English (English) / Livre sterling : ABCTEST

Execute orders.php or wait for the next hookbackOfficeTop call. And now check the logs, you will see multiple getOrders for ABCTEST