Skip to content

Commit a1615cd

Browse files
authored
feat(linux): suspend the local gateway across host sleep via logind (#122719)
* feat(linux): suspend the local gateway across host sleep via logind Mirror the macOS sleep cycle in the Tauri companion: a logind PrepareForSleep listener with a delay inhibitor best-effort prepares a local gateway suspension before sleep and resumes it on wake with a reconnect nudge and bounded retries; leases are route-bound, always cleared on wake, and late prepare responses resume immediately. * fix(linux): keep the sleep listener alive when inhibitor re-acquire fails * fix(linux): activate the driver for sleep cycles and bound driver-side sleep RPCs Sleep cycles temporarily unpark the gateway driver so prepare/resume work without the Quick Chat window; suspend RPCs carry a 3s driver-side budget that recycles a hung socket instead of starving wake retries; a mock-logind integration test exercises the Linux listener end to end. * fix(linux): count overlapping sleep cycles instead of a boolean flag An older wake task ending late cleared the shared activation flag and parked the driver mid-cycle; a saturating depth counter keeps the driver active until the last cycle ends. * fix(linux): gate sleep-cycle activation on loopback routes and never block wake on logind Remote or unconfigured routes no longer activate the driver during sleep, the paired end hook runs only for cycles that began, and wake recovery is spawned before the inhibitor re-acquire so a slow logind cannot delay reconnect/resume.
1 parent 9da43d6 commit a1615cd

11 files changed

Lines changed: 1502 additions & 42 deletions

File tree

‎apps/linux/src-tauri/Cargo.lock‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎apps/linux/src-tauri/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ cairo-rs = { version = "0.18.5", features = ["png"] }
5252
libc = "0.2.189"
5353
tauri-plugin-notifications = { git = "https://github.com/steipete/tauri-plugin-notifications.git", rev = "d20b4ff0e0e327e49fee80903478f825eac5a71a" }
5454
webkit2gtk = "2.0.2"
55+
zbus = { version = "5", default-features = false, features = ["tokio"] }
5556

5657
[target.'cfg(target_os = "macos")'.dependencies]
5758
tauri-plugin-notifications = { git = "https://github.com/steipete/tauri-plugin-notifications.git", rev = "d20b4ff0e0e327e49fee80903478f825eac5a71a", default-features = false }

0 commit comments

Comments
 (0)