fix(user-data-export): shorten download retention to 24 hours - #5188
Conversation
The completed export retention window was set to 7 days, but the data-exports UI copy states downloads expire 24 hours after the export is ready. Shorten the retention interval so the cleanup cron auto-removes exports 24 hours after completion, matching the stated behavior. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummarySingle-line retention change ( Files Reviewed (1 file)
Reviewed by kimi-k3 · Input: 43.1K · Output: 5.2K · Cached: 490.7K Review guidance: REVIEW.md from base branch |
Summary
The user data export feature set the completed export retention window to 7 days, but the Data Exports UI copy states that downloads expire 24 hours after the export is ready. This changes the retention interval so the behavior matches the stated copy.
Change
services/user-data-export/src/databases.ts: on export completion,expires_at = now() + interval '7 days'→interval '24 hours'.Why this makes auto-removal work as described
The cleanup cron already sweeps expired exports:
expiredObjects()selectsstatus = 'ready' AND expires_at <= now()markExpired()deletes the R2 object and marks the rowexpiredWith the shorter interval, exports are now auto-removed ~24 hours after they become ready, matching the UI text.
Related
Testing
vitest run— 56 passedvitest run --config vitest.workers.config.ts— 5 passed