Description
When clicking the "Preview Changes" button in the Sync tab, the operation fails immediately with an error message: "Sync failed: Failed to get API session"
Steps to Reproduce
- Open the Eidolon dashboard
- Navigate to the Sync tab
- Configure workspace (if not already done)
- Click the "Preview Changes" button
- Observe the error popup
Expected Behavior
The preview should show what changes would be synced (dry-run mode), displaying:
- Which projects would be created/updated
- Which files would be modified
- Summary statistics
Actual Behavior
Error popup appears: "Sync failed: Failed to get API session"
Technical Details
- File:
entrypoints/dashboard/main.ts (line 1931-2027, syncNow() function)
- The function requests API session via:
browser.runtime.sendMessage({ action: 'get-api-client-session' })
- Background service worker may not be properly initialized or session may be expired
Root Cause
The dashboard is running in a different context than the background service worker and may need to validate/refresh the session before attempting sync operations.
Suggested Fix
- Add session validation check before sync operations
- Implement session refresh mechanism
- Better error handling with user-friendly messages
- Consider caching session info in dashboard state after initial validation
Description
When clicking the "Preview Changes" button in the Sync tab, the operation fails immediately with an error message: "Sync failed: Failed to get API session"
Steps to Reproduce
Expected Behavior
The preview should show what changes would be synced (dry-run mode), displaying:
Actual Behavior
Error popup appears: "Sync failed: Failed to get API session"
Technical Details
entrypoints/dashboard/main.ts(line 1931-2027,syncNow()function)browser.runtime.sendMessage({ action: 'get-api-client-session' })Root Cause
The dashboard is running in a different context than the background service worker and may need to validate/refresh the session before attempting sync operations.
Suggested Fix