shoppingflux / shoppingfluxexport

7 stars 7 forks source link

Duplicate getOrders calls for the same token despite 60 secondes time restriction #397

Open ghost opened 5 years ago

ghost commented 5 years ago

Expected behaviour

It shouldn't be possible to have getOrders calls in less than 60 seconds apart.

Actual behaviour

The current hookbackOfficeTop function is looping over tokens to send a getOrders call. hookbackOfficeTop cannot be executed if already called less than 60 seconds ago.

This is done thanks to SHOPPING_BACKOFFICE_CALL.

However, in some situation, when two identical tokens are being used (for example one global token and one for French / Euro), we will loop over it. Then a duplicate call to getOrders will be made for the same token.

To avoid this situation, there should be an additional restriction with SHOPPING_BACKOFFICE_CALL in order to register the execution time for each single token instead of a global value.

Steps to reproduce the behaviour

Set up to identical tokens for "General" and "Français (French) / Euro". Then access to the backoffice (or call orders.php). You will then see two getOrders call for the same token.