BUG: upload.js AMPP sync is fire-and-forget — errors swallowed silently with no retry #77
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixed in
04ce096. Migration 020 addsassets.ampp_sync_status / ampp_sync_attempts / ampp_sync_next_attempt_at / ampp_sync_last_error.syncToAmpp()now writes those fields on every attempt (synced / failed with exponential backoff up to 8 attempts). The scheduler tick picks up pending/failed rows whosenext_attempt_athas arrived and retries them. AMPP being disabled marks the asset rowdisabledinstead of silently doing nothing.Fix Plan — #77 AMPP sync is fire-and-forget
Root cause: upload.js calls syncToAmpp() at end of /complete and /simple without await. Failed AMPP sync silently lost — asset never gets ampp_folder_id or ampp_synced_at.
Fix — add BullMQ retry queue for AMPP sync:
Worker handles AMPP API call with retry logic. On permanent failure, set asset error flag.
Files: src/routes/upload.js, new ampp-sync worker
Effort: ~2h
**Priority: P2 — data loss