Skip to content

#240 - Stream the log file download, bound the uploaded file names, detach the ended process executions - #241

Merged
njoubert-cleverage merged 1 commit into
mainfrom
240
Nov 3, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
240

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #240.

  • Log file download: ProcessExecutionCrudController::downloadLogFile() streams the file with a BinaryFileResponse instead of loading it with file_get_contents(). A log file bigger than the memory limit can now be downloaded, and range requests are supported. The Content-Disposition header is built by setContentDisposition(), so the file name is no longer quoted when it does not need to be. A missing or unreadable file still answers 404.
  • Uploaded file names: with the new UploadedFileManager::getSafeExtension() / getSafeName():
    • the launch form keeps only the letters and digits of the client extension, 16 at most (uuid.csv; no dot when nothing is left). A long extension made the writing fail (500, the exception message containing the path).
    • the HTTP API keeps the client file name when it fits. Otherwise, it truncates the name on a character boundary and reduces the extension the same way, so that <date>_<uniqid>_<name> stays under 255 bytes. A long name made the writing fail, caught by the value resolver: 422 "process code missing".
  • Ended process executions: ProcessEventSubscriber detaches the process execution from the entity manager once it has ended, after the ProcessExecutionEndedEvent (also when a listener fails). It uses the new ProcessExecutionManager::detachLastProcessExecution() and ProcessExecutionRepository::detach() (no-op when the entity is not managed or the entity manager is closed). Without a reset of the services (processes executed in a loop, tests, FrankenPHP worker mode), every ended execution stayed in the identity map. getLastProcessExecution() still returns it, e.g. for its id in the HTTP API error message.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None. A file uploaded with the launch form keeps a different extension only when its extension had characters other than letters and digits, or more than 16 of them.

🤖 Generated with Claude Code

…etach the ended process executions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage requested a review from a team as a code owner November 3, 2026 09:13
@njoubert-cleverage
njoubert-cleverage merged commit 51fced8 into main Nov 3, 2026
25 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.

Log file download loaded in memory, uploaded file names too long for the file system, ended process executions kept by the entity manager

1 participant