Upload sessions – system description

The session table, list filters and scope, and the deletion steps: part file, cancelling the Drive session, deleting the row.

Review and clean-up of the sessions of interrupted chunked, large and direct Drive uploads, protecting the web hosting space limit.

Data model

Table names carry the installation's own prefix in the database.

TableRole
upload_sessionsession: purpose (iphone_backup, document_large, document_drive), state (open, complete, aborted, expired), offset, size, company, user; owner: the phone backup model

Process

  1. List: filter by purpose and state; a completed Drive session is flagged separately; a message if the schema is missing.
  2. Delete: id format (32 hex); the local .part file is deleted (freed bytes), an open Drive resumable session is cancelled (cancelResumable), then the row is deleted; the file of a completed Drive upload stays on the Drive.

Permissions

  • Function rights: list (UNMAPPED), delete, debug.
  • Content scope: list getAllowedCompanyIds; delete sessionInScope (super admin everything; for a row without company only one's own).
Related topics: upload storage