Skip to content

[files] Store the content of the output files and the upload date - #1323

Merged
frankrousseau merged 3 commits into
cgwire:mainfrom
frankrousseau:feature/file-transfer
Oct 29, 2026
Merged

frankrousseau merged 3 commits into
cgwire:mainfrom
frankrousseau:feature/file-transfer

Conversation

@frankrousseau

@frankrousseau frankrousseau commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • Only the working files have a file route: a client cannot store or fetch the content of an output file.
  • Nothing records that the file store has the content of a file: a client cannot tell a local file from a synced one without a request for each file.
  • An upload over 2 GB fails: size is an Integer on working_file and output_file.
  • Any member of the team, client included, can download every working file of the project.

Solution

  • Add GET and POST /data/output-files/<id>/file, under the output prefix of the file store.
  • Add a nullable uploaded_at column to working_file and output_file, and turn their size into BigInteger (migration). The upload routes set both.
  • Upload an output file as a manager of the project or an assignee of the entity, never as a client.
  • Download an output file or a working file as a manager or supervisor of the project, or as an artist or vendor with a task on the entity or on a shot the asset is cast in. A client downloads neither.

@NicoPennec

Copy link
Copy Markdown
Member

Two items to address before merging:

  1. Permissions: OutputFileFileResource only checks check_project_access. For the POST, I'd reuse the rule of the CRUD update (OutputFileResource.check_update_permissions: project manager, or working on the entity). For the GET, add check_entity_access, like the CRUD read and the working file route.
  2. size is an Integer on working_file and output_file: an upload over 2 GB stores the content, then the update fails with "integer out of range" (500, uploaded_at stays empty). Same fix as for the attachments (1caf005): turn both columns into BigInteger in this migration.

Minor follow-up: deleting output files (with their entity or project) leaves their content in the store. Marking ("files", "output", id) deleted in the stored file registry would clean it up.

frankrousseau and others added 2 commits October 29, 2026 11:07
The working files and the output files get a nullable column
uploaded_at: the upload route sets it, with the size of the uploaded
file. Thus a client knows which files the file store has from one list
request. The output files get the same file route as the working files
(/data/output-files/<id>/file, prefix output in the file store).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
size was an Integer on working_file and output_file: an upload over 2 GB
stored the content, then the update failed with "integer out of range".
The upload date migration turns both columns into BigInteger, as done
for the attachments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The output file routes only checked the project access, so a client or
any member of the team could read or replace the content of every output
file. Uploading now takes a manager of the project or an assignee of the
entity, never a client. Downloading an output file or a working file
takes a manager or a supervisor of the project, or an artist or a vendor
with a task on the entity or on an entity the asset is cast in, as for
building the scene of a shot. A client downloads neither.

The output file route specs move to the blueprint spec file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frankrousseau
frankrousseau merged commit 5570373 into cgwire:main Oct 29, 2026
13 checks passed
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