Plan deletion of abandoned uploads

7 June 2026

A woman tears a sheet of paper at a conference table.
Illustrative photograph. Cropped and resized. Photo by Kampus Production on Pexels. · Pexels License

Base cleanup on the last confirmed activity for the upload, and recheck its state immediately before deletion. An old start time alone is a poor reason to remove chunks that a client is still sending.

Apply one cutoff to two different sessions

Suppose a test environment has an agreed inactivity cutoff of 24 hours. Upload A left three chunks and a job stub. Its last confirmed activity was 08:00 on Monday. Upload B began on Tuesday at 08:15 and had just started sending data. The cleanup worker runs at 08:30 on Tuesday. The times use one clock and timezone.

SessionInactivity at the checkProposed action
Upload A24 hours 30 minutesCandidate for cleanup, subject to a final activity and state check.
Upload B15 minutesDefer. Retain the active session and its chunks.

The 24 hours are an example setting. Specify the organisation's actual rule, which events refresh the clock and what happens at the exact boundary. A temporary-file retention schedule can document the choice, but a value selected for a different object type does not automatically apply to unfinished uploads. Example retention schedule

Prevent a late chunk from racing the cleanup

Take the first session off the candidate list if it has resumed since the initial scan. A system may use a session version, lease or conditional state change to ensure that only the unchanged, expired session can be cleaned. Test the case where a new chunk arrives between listing candidates and applying the decision.

Record the harmless session ID, last activity, expected objects and actual outcome. If the three chunks are removed but the stub update fails, leave enough state to reconcile the outstanding step. Do not label a dry run as a completed deletion. A useful cleanup report shows which items were removed, which were deferred and why.

Part of the Set retention and deletion requirements for PDF tools guide.

Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).