We have recently had some issues with duplicate orders being created in BC and found this is caused by the Live Integration sending the order at the same time as the "Sync queued orders" task.
We have found that this caused by the incorrect implementation of "Finished after X minutes". In the DW code this is using the "ToDate" of the order filter which is referring to the "OrderDate" and not the "OrderCompletedDate". This results in finding an order immediately that may have been created more than 15 minutes previously, but only just completed. So effectively this "Finished after X mins" really only has a random usefulness even if it is changed to a long duration as carts (order records) can be created days before checkout.
Has anybody noticed this issue before? Any workaround or suggestions for this?
From QueuedOrdersSyncScheduledTask.cs:
From OrderRepository.cs: