From e6fd112559e0a425695edba57394501ba0de56e5 Mon Sep 17 00:00:00 2001 From: Vedant Mohan Goyal <83997633+vedantmgoyal9@users.noreply.github.com> Date: Fri, 30 Jan 2026 08:59:30 +0530 Subject: [PATCH] Store RemoteAuth ZIP files inside dataPath (#3375) * Use `/tmp` when running inside AWS Lambda * Revert unintended change accidentally committed * Revert "Use `/tmp` when running inside AWS Lambda" This reverts commit 8e5324786e5b0067498717d3827937dac0f1edb6. * Store RemoteAuth ZIP files inside dataPath * Discard changes to src/webCache/WebCache.js --------- --- src/authStrategies/RemoteAuth.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/authStrategies/RemoteAuth.js b/src/authStrategies/RemoteAuth.js index 59d97bd..a14106d 100644 --- a/src/authStrategies/RemoteAuth.js +++ b/src/authStrategies/RemoteAuth.js @@ -106,8 +106,8 @@ class RemoteAuth extends BaseAuthStrategy { const pathExists = await this.isValidPath(this.userDataDir); if (pathExists) { await this.compressSession(); - await this.store.save({session: this.sessionName}); - await fs.promises.unlink(`${this.sessionName}.zip`); + await this.store.save({session: path.join(this.dataPath, this.sessionName)}); + await fs.promises.unlink(path.join(this.dataPath, `${this.sessionName}.zip`)); await fs.promises.rm(`${this.tempDir}`, { recursive: true, force: true, @@ -119,7 +119,7 @@ class RemoteAuth extends BaseAuthStrategy { async extractRemoteSession() { const pathExists = await this.isValidPath(this.userDataDir); - const compressedSessionPath = `${this.sessionName}.zip`; + const compressedSessionPath = path.join(this.dataPath, `${this.sessionName}.zip`); const sessionExists = await this.store.sessionExists({session: this.sessionName}); if (pathExists) { await fs.promises.rm(this.userDataDir, { @@ -143,7 +143,7 @@ class RemoteAuth extends BaseAuthStrategy { async compressSession() { const archive = archiver('zip'); - const stream = fs.createWriteStream(`${this.sessionName}.zip`); + const stream = fs.createWriteStream(path.join(this.dataPath, `${this.sessionName}.zip`)); await fs.copy(this.userDataDir, this.tempDir).catch(() => {}); await this.deleteMetadata();