BUG: upload.js AMPP sync is fire-and-forget — errors swallowed silently with no retry #77

Closed
opened 2026-05-25 06:28:59 -04:00 by zgaetano · 1 comment
Owner

Fixed in 04ce096. Migration 020 adds assets.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 whose next_attempt_at has arrived and retries them. AMPP being disabled marks the asset row disabled instead of silently doing nothing.

Fixed in 04ce096. Migration 020 adds `assets.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 whose `next_attempt_at` has arrived and retries them. AMPP being disabled marks the asset row `disabled` instead of silently doing nothing.
Author
Owner

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:

// Instead of fire-and-forget:
await amppSyncQueue.add('sync', { assetId }, {
  attempts: 3,
  backoff: { type: 'exponential', delay: 5000 }
});

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

## 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:** ```js // Instead of fire-and-forget: await amppSyncQueue.add('sync', { assetId }, { attempts: 3, backoff: { type: 'exponential', delay: 5000 } }); ``` 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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#77
No description provided.