From 373d0446ed1eda5999b77d3ff56d4698de47d25c Mon Sep 17 00:00:00 2001 From: Nicola Fabiano Date: Thu, 11 Jun 2026 17:48:34 +0200 Subject: [PATCH] fix(RemoteService): remove redundant stream cleanup in convertFileTo() The raw stream is handed to the Guzzle-based HTTP client as the request body; Guzzle wraps it in a PSR-7 stream and closes the underlying resource once the request has been sent. The fclose() call in the finally block therefore always operates on an invalid resource and logs a warning on every conversion (e.g. one per generated preview). Drop the try/finally block and rely on the HTTP client to close the stream, as suggested in review. Fixes #5743 Signed-off-by: Nicola Fabiano --- lib/Service/RemoteService.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/Service/RemoteService.php b/lib/Service/RemoteService.php index 3165cd6091..3e70ebe320 100644 --- a/lib/Service/RemoteService.php +++ b/lib/Service/RemoteService.php @@ -67,11 +67,7 @@ public function convertFileTo(File $file, string $format, int $timeout = RemoteO throw new Exception('Failed to open stream'); } - try { - return $this->convertTo($file->getName(), $stream, $format, [], $timeout); - } finally { - fclose($stream); - } + return $this->convertTo($file->getName(), $stream, $format, [], $timeout); } /**