This will NOT solve/mitigate all of the underlying causes of failed/stalled Inventory Syncs, as those are by yet undiscovered issues in the Wayfair Plugin code and/or they are the result of limitations placed on the Wayfair Plugin by the Plentymarkets system.
Fixes
Set inventory sync state in the database to IDLE immediately after detecting a stale/stalled Inventory Sync, to avoid letting the stale/stalled run block any subsequent runs.
The partial inventory cron job that runs every 15-30 minutes will do this
The change in state will allow the UI to do a "manual" full sync within 1 hour of a "stall."
Do not let a failed Inventory data creation for one product prevent inventory data creation for another product.
Lower "maximum time for full sync" to 4 hours instead of 6 hours.
Enhancements
re-enable logging statements that are specific to FullInventorySynCron so that we can filter down to Full Inventory Syncs in Plentymarkets logs
bump logging level for all Cron jobs to INFO so that we can track them without the noise of turning on DEBUG logs
Testing changes
add test cases for "should inventory syncing start?"
add test cases for "should inventory syncing be marked as complete?"
add test cases for "should inventory syncing be cancelled?"
add new TestTimeLogger module to allow the developer to see the logs being produced by tests
use TestTimeLogger during tests for sync method of `InventoryUpdateService
Code Health changes
move "sync page of inventory" logic to its own testable subroutine
fix type hints for inputs in LoggerContract and LoggingService
add null pointer protection when parsing inputs to methods in LoggingService
add missing type hint for EnternalLogs used in sync method of InventoryUpdateService
add import statements to VariationDataFactory in the Plentymockets library, to fix test execution when phpunit is run manually
Mitigating https://github.com/wayfair-contribs/plentymarkets-plugin/issues/204 where a supplier's inventory synchronization process is stuck at the first attempt to upload all inventory to Wayfair.
This will NOT solve/mitigate all of the underlying causes of failed/stalled Inventory Syncs, as those are by yet undiscovered issues in the Wayfair Plugin code and/or they are the result of limitations placed on the Wayfair Plugin by the Plentymarkets system.
Fixes
IDLE
immediately after detecting a stale/stalled Inventory Sync, to avoid letting the stale/stalled run block any subsequent runs.Enhancements
FullInventorySynCron
so that we can filter down to Full Inventory Syncs in Plentymarkets logsINFO
so that we can track them without the noise of turning onDEBUG
logsTesting changes
TestTimeLogger
module to allow the developer to see the logs being produced by testsTestTimeLogger
during tests forsync
method of `InventoryUpdateServiceCode Health changes
LoggerContract
andLoggingService
LoggingService
EnternalLogs
used insync
method ofInventoryUpdateService
VariationDataFactory
in thePlentymockets
library, to fix test execution whenphpunit
is run manually