Data Retention and Deletion Policy
How long Supplier Stock Sync keeps each kind of data, and how it is deleted. Each item names the code that enforces it.
| Data | Kept for | How it ends |
|---|---|---|
| Run details (each change and each problem) | 90 days | Deleted by the hourly job (SystemRepo.pruneOld). |
| Run summaries | 400 days | Deleted by the hourly job once their details are gone. |
| Suppliers, feeds, feed credentials, mappings, settings, price approvals | While the app is installed | Deleted with the store's data (below). A supplier deleted in the app takes its feeds, mappings, approvals and SKU records with it at once. |
| Price checks (catalogue audits) | The last 10 per store, and at most 60 days | Older ones are deleted when a new one finishes, and by the hourly job. |
| Shopify API usage (daily totals) | 400 days | Deleted by the hourly job. |
| Activity log and email log | 12 months | Deleted by the hourly job. Neither holds feed credentials or tokens. |
| Webhook delivery ids (replay protection) | 30 days | Deleted by the hourly job. |
| Scheduled-slot records | 7 days | Deleted by the hourly job. |
| Rate-limit counters | 2 days | Deleted by the hourly job. Hold no personal data. |
| Shopify tokens (encrypted) | While installed | Deleted the moment the `app/uninstalled` webhook arrives. |
| Everything for a store | Until uninstall + Shopify's `shop/redact` (48 h), or 30 days after uninstall at most | `shop/redact` deletes immediately; the hourly job deletes any store uninstalled more than 30 days ago that never received one. Reinstalling within that time cancels the deletion. |
Backups: Cloudflare D1 Time Travel keeps a 30-day point-in-time history; deleted data leaves it after 30 days.
Legal holds: if we are legally required to keep specific data longer, we keep only that data, only as long as required.