-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Is there an existing issue for this?
- I have searched the existing issues.
Is this a problem caused by your code, or is it specifically because of the library?
- I have double-checked my code carefully.
Describe the bug.
When using RemoteAuth, if the process crashes (e.g., power loss, forced quit) while storeRemoteSession() is running, it may leave behind orphan artifacts:
- A half-written ${sessionName}.zip (created in compressSession()), which can later cause unzip errors.
- wwebjs_temp_session_ directories that are copied but never deleted.
These files are not automatically cleaned up, and can cause corrupted restores or disk bloat over time.
Expected Behavior
The .zip should either be fully written or not present at all (atomic write).
Temporary folders should be cleaned up on crash/restart.
On startup, RemoteAuth should ignore/delete any old orphaned files before trying to restore.
Steps to Reproduce the Bug or Issue
Initialize a client with RemoteAuth.
Let it run until the first backup sync starts (afterAuthReady → storeRemoteSession()).
Force kill the process (Ctrl+C, SIGKILL, or simulate power loss) while compressSession() is writing the zip.
Restart the process.
WhatsApp Account Type
Standard
Browser Type
Google Chrome
Operation System Type
Windows
Phone OS Type
Android
WhatsApp-Web.js Version
1.32.0
Authentication Strategy
RemoteAuth