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 Linux
Linux 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
Description
Session inheritance via
inheritSessionFromparameter in/tabs/openworks 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):
/login(logged out)On macOS:
Environment
persist:tandemInvestigation
The IndexedDB copy appears to complete without errors, but Discord auth state is not properly restored on Linux:
Root Cause Hypothesis
Timing/race condition in
src/tabs/manager.tscopyIndexedDbFrom():Linux filesystem I/O may be slower than macOS, causing the
loadURLto execute before IndexedDB writes finish.Possible Fix
Add explicit wait for IndexedDB transaction completion in
buildIndexedDbRestoreScript():Or use IndexedDB transaction
.oncompletecallbacks.Impact
Related