Data sync

How your catalog, stock, orders and customers reach Conviro: the continuous (event) sync, the initial historical sync, re-syncs, repair, and where to watch progress. Plan §20 items 6, 7 and 14; P4.1–P4.3. Code: AiChat/Service/Sync/*, AiChat/Service/Inventory/*, backend magento-commerce-sync.service.ts. Read 2026-09-24; measured on the local 2.4.7-p4 stack only (sync-jobs.sh 57/57, catalog-resync.sh 21/21).

Continuous sync (events)

Changes in Magento are queued locally and delivered by cron every minute (Architecture); the event reference lists every trigger and field.

DataSent whenSwitch
Productssaved or deleted in the admin / by API; disabled products are sent as disabledSync Products to KB (default off; on after wizard step 5 Catalog)
Stockchanged in the admin, by the MSI API, or by Magento's catalog import; one event per product, the latest state winsSync Products to KB
Ordersplaced, state/status changed, shipped (new shipment), refundedSend Order Events (default on)
New customersstorefront registration → a lead in ConviroCreate Leads on Registration (default on)
Carts, failed paymentssee Cart recovery and payment assistoff by default, need confirmation

Not covered by events (Magento does not dispatch the product-save event for them): the catalog import of product data and the admin Update attributes mass action. Run Re-sync catalog after such changes.

Initial historical sync

Started from wizard step 5 (Save and start initial sync); each type is a background job run by Magento cron.

JobWhat it sendsScopeEvent type
Catalogevery enabled, website-assigned product with visibility catalog, search or both, built for the default store view; configurable children travel inside their parentcatalog-wideproduct.updated with resync: true
Inventorythe current stock of every eligible productcatalog-wideinventory.updated with resync: true
Order historyorders of the selected store views created inside the window (30 / 90 / 365 days, default 90), window fixed when the job startsselected store viewsorder.synced
Customers (opt-in)existing accounts of the selected store views (admin-created accounts count as the default store view)selected store viewscustomer.synced

History is quiet by construction: Conviro stores it in commerce_orders / commerce_customers and nothing else happens — no leads, e-mails, notifications, flows or cart-recovery cancellations. Orders keep order number, status, total, currency, item count, guest flag, dates and a one-way hash of the e-mail; customers keep id, group, website, account date and the hash. No names, addresses, phone numbers or line items.

How jobs run

Re-sync and repair (Integration Health card)

ButtonDoesNotes
Re-sync catalogthe catalog job againRefused while Sync Products to KB is off. A re-synced product whose knowledge-base text did not change costs Conviro no re-embedding and no cache scan.
Re-sync inventorythe inventory job againCoalesces with stock events already waiting.
Re-sync recent orders (N days)the order-history jobN = the wizard's window; 30 when you chose none.
Import customersthe customer jobShown only when Customers was ticked in step 5.
Repair failed itemsfixes events that failed for good (dead) or were dropped, up to the newest one at startPayload still stored → re-queued with a fresh retry budget. Payload gone → rebuilt from Magento's current data: product → product.updated (or product.deleted if the SKU no longer exists), order → order.synced, stock → inventory.updated; the original is marked repaired. Cart, payment, customer, test and progress events are skipped (not rebuilt). Measured: 1 requeued, 4 rebuilt, 2 skipped; a second repair rebuilt nothing.
Retry failedputs dead and blocked events back in the queue as they areFor after you fixed the cause (e.g. a rejected API key).

Each button is disabled while its job runs.

Watching progress

The nightly REST pull (Conviro side)

Independently of the module, a workspace with Conviro's KB sync enabled has Conviro pull the product list over REST every night (02:00 server time). It renders the same knowledge-base text as product events, keeps products that are visible in catalog or search, and deactivates entries for products no longer listed — only after a complete listing. A product that an event has described keeps the attribute and variant blocks the module sent.

Known limits