fix: requeue orphaned pending configurations; independent background sync streams

- Configurations stuck in sync_status=pending without a pending_changes row are
  re-enqueued as an update with the current snapshot on each push cycle.
- Background cycle no longer aborts pricelist/partbook/settings sync when push or
  readiness fails; each stream logs its own error.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Mikhail ChusavitinandClaude Sonnet 5 committed 2026-10-05 11:53:44 +03:00
1 parent 310b296045
commit cccb8890a4
5 files changed
+143 -11

No files matched your search

+2
View File
@@ -75,6 +75,8 @@ Update this file in the same commit as any change to the flows below.
- `POST /api/sync/push` drains the queue by writing to MariaDB.
- If a push fails, `increment_attempts` and `last_error` are updated; row stays in queue.
- `RepairPendingChanges` reconciles orphaned changes (configuration/project deleted locally).
- Background cycle (`sync.Worker.runSync`) runs independent streams: push (gated by readiness guard), then pricelists, partnumber books, qt_settings. A failure in one stream is logged and never stops the others.
- Configurations left `sync_status=pending` with no `pending_changes` row (queue row dropped, e.g. a stale event skipped without marking synced) are re-enqueued as an `update` with the current snapshot at the start of each push (`requeueOrphanedPendingConfigurations`).
---