-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Bug Description
After the system goes to sleep and resumes, if dumber browser was open, navigation (both within a site and to external sites) stops working. Pages load indefinitely and the browser must be restarted to recover.
Observed while browsing github.com on a laptop.
Root Cause Analysis
After investigating the codebase, the issue is that dumber has no handling for system sleep/wake events. Several potential causes:
1. No Sleep/Wake Event Listening
The application doesn't know when the system goes to sleep or wakes up. There's no listener for:
org.freedesktop.login1.Manager.PrepareForSleep(bool going_to_sleep)D-Bus signal
2. Stale Network/WebKit State
After resume:
- WebKit network sessions may hold stale connections
- DNS cache may be invalid
- TLS sessions may have expired
- The
NetworkSessionininternal/infrastructure/webkit/context.gois created once and never refreshed
3. No Web Process Crash Recovery
If WebKit's web process becomes unresponsive after sleep, there's no handling:
- No
web-process-crashedorweb-process-terminatedsignal handlers - No automatic reload or error page mechanism
Current Related Code
internal/infrastructure/idle/portal_inhibitor.go- Only prevents sleep (for video playback), doesn't react to sleep/wakeinternal/infrastructure/webkit/context.go- Single sharedNetworkSession, no refresh mechanisminternal/infrastructure/webkit/webview.go- No web process crash signal handlers
Proposed Solutions
Option A: Listen for PrepareForSleep (Recommended)
- Add D-Bus listener for
org.freedesktop.login1.Manager.PrepareForSleep - On wake (
PrepareForSleep(false)):- Optionally trigger page reload for active tabs
- Or at minimum, log the event for debugging
Option B: Add Web Process Crash Handling
- Connect to WebKit's
web-process-terminatedsignal - Show error page with reload option when web process dies
- Optionally auto-reload
Option C: Network State Monitoring
- Monitor
org.freedesktop.portal.NetworkMonitorfor connectivity changes - Refresh stale connections after network returns
Workaround
Restart the browser after system resume.
Environment
- Linux laptop with system sleep/hibernate
- Site: github.com (but likely affects all sites)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels