Skip to content

fix(user-data-export): shorten download retention to 24 hours - #5188

Merged
St0rmz1 merged 1 commit into
mainfrom
fix/data-export-24h-retention
Aug 10, 2026
Merged

fix(user-data-export): shorten download retention to 24 hours#5188
St0rmz1 merged 1 commit into
mainfrom
fix/data-export-24h-retention

Conversation

@St0rmz1

@St0rmz1 St0rmz1 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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() selects status = 'ready' AND expires_at <= now()
  • markExpired() deletes the R2 object and marks the row expired

With the shorter interval, exports are now auto-removed ~24 hours after they become ready, matching the UI text.

Related

Testing

  • vitest run — 56 passed
  • vitest run --config vitest.workers.config.ts — 5 passed

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>
@kilo-code-bot

kilo-code-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Single-line retention change (interval '7 days'interval '24 hours' on export completion) reviewed with high confidence: the SQL is valid, all expires_at consumers (expiredObjects, markExpired, readyObject, pendingNotifications, downloadExpiration) evaluate it dynamically, and the 5-minute cleanup cron enforces expiry promptly. The email template renders expiry_date dynamically, so no copy mismatch there; the Data Exports UI copy still referencing 7 days is unchanged in this PR and is explicitly covered by companion PR #5187. No tests assert the old interval, and no memory-leak or security concerns arise from this change.

Files Reviewed (1 file)
  • services/user-data-export/src/databases.ts

Reviewed by kimi-k3 · Input: 43.1K · Output: 5.2K · Cached: 490.7K

Review guidance: REVIEW.md from base branch main

@St0rmz1
St0rmz1 merged commit d00da2f into main Aug 10, 2026
13 checks passed
@St0rmz1
St0rmz1 deleted the fix/data-export-24h-retention branch August 10, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants