From 98c8cc425c721e0965dd97d384b081f533d722ac Mon Sep 17 00:00:00 2001 From: Sergey Date: Thu, 29 May 2025 13:38:22 +0300 Subject: [PATCH] fix: improve session ID extraction from credentials directory The change correctly handles session IDs that contain underscore characters by using lastIndexOf('_') to find the '_credentials' suffix. This ensures that session IDs like 'my_test' are properly loaded from 'my_test_credentials' directory. --- src/Socket/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Socket/index.ts b/src/Socket/index.ts index 19a9e62..6bdf79c 100644 --- a/src/Socket/index.ts +++ b/src/Socket/index.ts @@ -300,7 +300,7 @@ export const loadSessionsFromStorage = () => { throw err; } for (const dir of dirs) { - const sessionId = dir.split("_")[0]; + const sessionId = dir.slice(0, dir.lastIndexOf('_')); if (!shouldLoadSession(sessionId)) continue; startSession(sessionId); }