Repository navigation
feat(network): sync only on known networks (#96) - #98
Merged
Merged
Conversation
The known-network list is a Sync setting, off by default. While it is on, uploads and scans wait unless the OS names the current wireless network in the list; a wired connection always syncs and the check fails closed on an unknown name, a missing answer, an OS error, or no network at all. The pure check, the hold and the poll live in sync-core behind one NetworkSource trait; the shell answers it per platform: NetworkManager over D-Bus on Linux, the Network List Manager plus the IP helper's adapter types on Windows, and CoreWLAN, CaptiveNetwork and Location Services on macOS. Each backend also reports OS change events, with a 30-second poll as the net under them and a re-check after any upload network error. The pause is a second hold beside the user's own: Status carries the reason, so the dashboard and tray read 'Paused - not on a known network' or 'Paused - network unknown', and Resume cannot override the list.
#96) The Current network row was a side-by-side setting row, so a long reason pushed the value past the page edge. It is now a stacked row whose value wraps under the title, and the value no longer repeats the row's own words: it is the name, 'wired', or 'unknown - <reason>'. macOS never showed the Location prompt from a local build. The prompt needs an app bundle, so a 'cargo run' binary has no usage string to show; the settings page now asks at open when the list is already on (as well as on the switch), carries NSLocationUsageDescription as well as the When-In-Use key, and offers Open Location Settings when the grant is missing. The README and the hand-check notes say the prompt only works from the installed app.
macOS CI runs clippy on the real arm64 target, where libc's ifa_flags is already u32, so the try_from conversion was a no-op lint error. The probe scripts now run clippy rather than check, so the same class cannot pass a local probe again.
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.
Closes #96.
Summary
Sync only on known networks is a Sync setting, off by default, with a list of names you type. On, uploads and scans wait unless the OS names the current wireless network in the list; a wired link always syncs, and an unprovable network holds.
The hold is separate from the user's pause, so Resume cannot override the list;
Status.pausecarries the reason to the dashboard and the tray.Evidence
cargo nextest run --locked --workspace: 941 passed, 2 skipped.cargo clippy --workspace --all-targets -D warningsandcargo fmt --checkclean.crates/sync-core/tests/it/network.rs): listed, not listed, list off, wired, empty name, OS error and recovery, leaving a listed network (queue kept), returning (resumes without a click), the poll noticing a missed event, an upload network error re-checking, a hung OS call timing out and holding, a closed event channel not spinning.docs/network-hand-checks.md).Merge Danger
Door: two-way. The setting defaults off (existing behaviour), the settings file gains two fields with defaults, and nothing is deleted or migrated.
Blast Radius: contained — one new setting; the only always-on paths are the engine's network check (platform syscall per 30s while the engine runs) and one startup read.
Docs: SPEC R8.8, GLOSSARY, ADR 0008 (Location prompt), README,
docs/network-hand-checks.md.