feat(update): allow disabling the update check (LAN-235)#137
Merged
lance0 merged 3 commits intoJul 7, 2026
Conversation
The background "newer release available" check (update-informer against the GitHub API, run in TUI mode) had no opt-out, which is unwanted when xfr is installed from a package repository or run in locked-down environments. Add opt-outs at every layer: - --no-update-check CLI flag - DO_NOT_TRACK (cross-tool standard) / XFR_NO_UPDATE_CHECK env vars - [client] no_update_check in config.toml - an "Update check" toggle in the TUI Settings (Display tab), persisted to prefs.toml (disable_update_check) so it sticks across runs - an update-check cargo feature (default-on): --no-default-features drops the update-informer dependency entirely, so package builds ship no phone-home code Resolution precedence: compiled-out > env > CLI > config > saved pref.
The resolution OR-chain flattened the config/pref tristate with
unwrap_or(false), so Some(false) ("explicitly enabled") and None ("unset")
were indistinguishable: an explicit no_update_check = false in config.toml
could not re-enable the check over a stale disable_update_check = true in
prefs.toml.
Extract the resolution into update::check_disabled, where an explicit config
value wins over the saved pref (matching the existing theme CLI>config>saved
precedence). Add a unit test covering the precedence, including the
compiled-out path.
- examples/config.toml shipped an active `no_update_check = false`. Because an explicit config value wins over the saved pref (by design), that would defeat a user's persisted TUI "Update check: off" toggle for anyone who copied the example. Comment it out so an unset config lets the TUI toggle govern. - Document the control everywhere it's user-visible: --no-update-check in the README CLI table and man page CLIENT OPTIONS; DO_NOT_TRACK / XFR_NO_UPDATE_CHECK in the man page ENVIRONMENT section; and a "Disabling the update check" section in docs/FEATURES.md with the full precedence.
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.
Adds a full opt-out for the background "newer release available" check (
update-informer→ GitHub API, TUI mode only). Requested by a ttl user (lance0/ttl#110) as a standard package-manager/CI courtesy. Closes LAN-235.How to turn it off
Precedence (first that applies wins): compiled-out → env → CLI → config.toml → saved pref.
DO_NOT_TRACK=1(cross-tool standard) orXFR_NO_UPDATE_CHECK=1no_update_check = trueunder[client]prefs.toml(disable_update_check), sticks across runs--no-update-checkupdate-checkcargo feature (default-on);--no-default-featuresdropsupdate-informerfrom the tree entirely — no phone-home code shippedNotes for review
run_tui_loop); the gate sits there.update_check_touched), so untouched users don't get a spuriousprefs.tomlwrite.env_opt_outtreats an env var as "on" unless empty/0/false.Validation
cargo tree --no-default-features -i update-informer→ absent.clippy -D warningsclean on--all-featuresand--no-default-features;fmtclean.env_flag_truthiness+update_check_toggle_flips_and_marks_touched).--no-update-checkappears in--help.Files:
update.rs,config.rs,prefs.rs,tui/settings.rs,tui/ui.rs,main.rs,Cargo.toml,CHANGELOG.md,examples/config.toml.