Skip to content

Conversation

@rajpatel24
Copy link
Contributor

🗒️ Checklist

  1. run linter locally
  2. update developer docs (API, README, inline, etc.), if any
  3. for user-facing doc changes create a Zulip thread at #Support Docs Updates, if any
  4. draft PR with a title <type>(<scope>)<!>: <title> DEV-1234
  5. assign yourself, tag PR: at least Front end and/or Back end or workflow
  6. fill in the template below and delete template comments
  7. review thyself: read the diff and repro the preview as written
  8. open PR & confirm that CI passes & request reviewers, if needed
  9. delete this section before merging

📣 Summary

Automatically removes old anonymous exports to prevent outdated files from being accessible and to keep storage usage under control.

📖 Description

Anonymous exports are now cleaned up automatically after they expire. A new recurring background task deletes export files and their corresponding records once they are older than the value defined in ANON_EXPORTS_CLEANUP_AGE (configured in Constance, default: 30 minutes).

To ensure system stability, the cleanup runs in small batches of 50 exports per execution and uses a distributed lock to prevent multiple workers from deleting the same exports simultaneously. This keeps storage usage under control and prevents outdated anonymous export files from remaining accessible.

Authenticated exports and other project data are not affected.

@rajpatel24 rajpatel24 self-assigned this Nov 27, 2025
@rajpatel24 rajpatel24 removed the request for review from jnm November 27, 2025 15:07
@rajpatel24 rajpatel24 force-pushed the dev-1358-erase-anonymous-exports branch from aba37e9 to 39e3ede Compare November 27, 2025 15:08
@rajpatel24 rajpatel24 force-pushed the dev-1358-erase-anonymous-exports branch from 39e3ede to f0e833d Compare November 27, 2025 15:10
'Enable automatic deletion of attachments for users who have exceeded '
'their storage limits.'
),
'ANON_EXPORTS_CLEANUP_AGE': (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be consistent with other similar variables. e.g.: *_GRACE_PERIOD.
Also I would write ANONYMOUS_EXPORTS_... .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants