migrating-nango-deletion-detection
Installation
SKILL.md
Migrating Nango Deletion Detection
Do this
- Find legacy usage:
deleteRecordsFromPreviousExecutions(trackDeletes:/track_deletes
- For each sync + model that needs automatic deletion detection:
- Add
await nango.trackDeletesStart('ModelName')at the start ofexec(before fetching/saving). - Replace
await nango.deleteRecordsFromPreviousExecutions('ModelName')withawait nango.trackDeletesEnd('ModelName'). - Keep
trackDeletesEndafter allbatchSave/batchUpdate/batchDeletecalls.
- Add
- Safety:
- Only call
trackDeletesEndif the full dataset was fetched + saved betweentrackDeletesStartandtrackDeletesEnd(otherwise you can cause false deletions). - Prefer letting exceptions bubble. If you
catch, re-throw when data is incomplete.
- Only call
Checkpointed full refresh (multi-execution)
Full refresh syncs need a pagination checkpoint (page/cursor/offset) in addition to delete tracking. Nango syncs run inside a time-limited execution window; without a checkpoint, a run that does not finish in that window restarts from page 1 next time, wasting compute re-fetching the same early pages and never reaching the rest of the dataset.