Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for detecting system suspend and resume events in GUI mode, allowing the filesync client to immediately reconnect after a system resume. The main addition is a new
SuspendDetectorutility, which is integrated into the GUI manager's session loop. This improves user experience by minimizing sync delays after a laptop or system wakes up from sleep. The change also includes basic tests for the new detector.Suspend/resume detection feature:
SuspendDetectorutility (crates/filesync/src/suspend_detector.rs) that detects system suspend/resume by comparing wall-clock time with system uptime. On Linux, it reads/proc/uptime; on other platforms, it returns an unsupported error. ([crates/filesync/src/suspend_detector.rsR1-R71](https://github.com/guydols/ByteHive/pull/16/files#diff-e854a36d80dc4cdaf7f9cca2c9f03d1c25719e7e10b5d06b974b6ba3844e5aa0R1-R71))SuspendDetectorinto the GUI manager's session loop (crates/filesync/src/gui/manager.rs) to monitor for resume events and trigger immediate reconnection and user notification when a resume is detected. ([[1]](https://github.com/guydols/ByteHive/pull/16/files#diff-c6988c71cce54d886165a6e24dbe5234246e9ea011093c216a7783b138583b12R5),[[2]](https://github.com/guydols/ByteHive/pull/16/files#diff-c6988c71cce54d886165a6e24dbe5234246e9ea011093c216a7783b138583b12R86-R95),[[3]](https://github.com/guydols/ByteHive/pull/16/files#diff-c6988c71cce54d886165a6e24dbe5234246e9ea011093c216a7783b138583b12L145-R150))[crates/filesync/README.mdR343-R344](https://github.com/guydols/ByteHive/pull/16/files#diff-0be06c3d53c35473f47aad38f0a1bbebc7578e8e099cb380428a3ec360002a84R343-R344))Testing and module organization:
SuspendDetectorto ensure it initializes, implementsDefault, and its main method does not panic during normal operation (crates/filesync/tests/test_suspend_detector.rs). ([crates/filesync/tests/test_suspend_detector.rsR1-R27](https://github.com/guydols/ByteHive/pull/16/files#diff-2e52b2f7b05be8af788583df441bbb9efe076aac8f58912be15d747a4678746aR1-R27))suspend_detectormodule in the crate root (crates/filesync/src/lib.rs). ([crates/filesync/src/lib.rsR11](https://github.com/guydols/ByteHive/pull/16/files#diff-6de8e376aa17b37bb20763deed1e531218c6af89ad8e01571e55d27bc74f3b43R11))