-
Notifications
You must be signed in to change notification settings - Fork 74
[Bug] Session inheritance (inheritSessionFrom) fails on Linux but works on macOS #31
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Session inheritance via inheritSessionFrom parameter in /tabs/open works correctly on macOS but fails on Linux. New tabs created with session inheritance end up logged out instead of copying the auth state from the source tab.
Steps to Reproduce
-
On Linux (Ubuntu 24.04, Wayland):
- Open Discord and log in (tab-2)
- Create new tab with session inheritance:
curl -X POST http://127.0.0.1:8765/tabs/open \ -H "Authorization: Bearer \$TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "https://discord.com/channels/@me", "inheritSessionFrom": "tab-2"}'
- Expected: New tab opens logged in
- Actual: New tab redirects to
/login(logged out)
-
On macOS:
- Same steps work correctly ✅
- New tab inherits session and stays logged in
Environment
- Linux: Ubuntu 24.04 (Wayland), Tandem v0.65.5
- macOS: Working correctly (reported by user)
- Both platforms use same partition:
persist:tandem
Investigation
The IndexedDB copy appears to complete without errors, but Discord auth state is not properly restored on Linux:
# After session inheritance on Linux:
curl "http://127.0.0.1:8765/devtools/evaluate" \
-d '{"tabId": "tab-9", "expression": "document.cookie.includes(\\"__dcfduid\\")"}'
# Returns: false (no Discord cookies)Root Cause Hypothesis
Timing/race condition in src/tabs/manager.ts copyIndexedDbFrom():
await targetWc.executeJavaScript(this.buildIndexedDbRestoreScript(dumpJson));
await targetWc.loadURL(targetUrl); // <- May start before restore completes on LinuxLinux filesystem I/O may be slower than macOS, causing the loadURL to execute before IndexedDB writes finish.
Possible Fix
Add explicit wait for IndexedDB transaction completion in buildIndexedDbRestoreScript():
// After all database operations
return new Promise(resolve => {
setTimeout(() => resolve(true), 100); // Let IndexedDB flush
});Or use IndexedDB transaction .oncomplete callbacks.
Impact
- Severity: High - breaks core feature on Linux
- Workaround: None (users must manually log in to each new tab)
- Platform: Linux only
Related
- Introduced in: PR fix(tabs): copy IndexedDB from source tab on inheritSessionFrom #30 (IndexedDB copy feature)
- Commits: d3a4310, 682787f
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working