From ff83b55a52066ba779d7d0410af5c3ccf4825361 Mon Sep 17 00:00:00 2001 From: Elena Shostak <165678770+elena-shostak@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:07:15 +0000 Subject: [PATCH] [FSH] Dropped unnecessary `fs` persistence for synthetics project code (#244338) ## Summary Dropped unnecessary `fs` persistence for synthetics project code. __Relates: https://github.com/elastic/kibana/issues/239385__ --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 5b3dcf04d6613852e95c5356dafc8de42021d688) --- .../plugins/synthetics/server/common/unzip_project_code.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts b/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts index 551b738944e2d..3f33e93ab9406 100644 --- a/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts +++ b/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts @@ -6,7 +6,6 @@ */ import { join } from 'path'; -import { writeFile } from 'fs/promises'; import os from 'os'; import AdmZip from 'adm-zip'; @@ -20,9 +19,7 @@ export function generateTempPath() { export async function unzipFile(content: string) { const decoded = Buffer.from(content, 'base64'); - const pathToZip = generateTempPath(); - await writeFile(pathToZip, decoded); - const zip = new AdmZip(pathToZip); + const zip = new AdmZip(decoded); const zipEntries = zip.getEntries(); let allData = ''; @@ -31,5 +28,6 @@ export async function unzipFile(content: string) { const entryData = entry.getData().toString(); allData += entryData; } + return allData; }