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)
- Call
trackDeletesStart('ModelName')at the beginning of each execution in the refresh window (it is safe/idempotent while the window is open). - Call
trackDeletesEnd('ModelName')only in the execution that finishes saving the full dataset.