Skip to content

fix(drive): warn on a broken settings.json in lease resolve - #1720

Merged
newhoggy merged 2 commits into
mainfrom
issue-1695-settings-parse-warn
Sep 17, 2026
Merged

newhoggy merged 2 commits into
mainfrom
issue-1695-settings-parse-warn

Conversation

@newhoggy

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • cargo build
  • cargo test --lib cli::drive::lease:: (includes the new regression test)
  • cargo clippy --all-targets -- -D warnings

LeaseFlags::resolve used Settings::load().unwrap_or_default(), so a
settings.json that failed to parse silently reverted lease.biometrics_only
to device-owner authentication (password fallback allowed) and dropped
backup_dir/default_expiry_minutes, with nothing on stderr/logs. Now warns
via tracing::warn! before falling back to defaults, matching
docs/STYLE_GUIDE.md's STYLE-0018 silent-error-suppression guidance and the
existing tracing::warn! precedent in src/drive/lease/settings.rs.

Fixes #1695
@github-actions

Copy link
Copy Markdown

Coverage

Total: 97.27% ⚪ 0 pp vs main

Comparing 87d2112..ab101d8 (merge-base → PR head)

File Before After Δ
src/cli/drive/lease.rs 99.27% 98.96% 🔴 -0.31 pp
🔇 5 ignored region(s), 0 tolerated region(s)

ignore removes the lines from both reports; tolerate keeps them in the reported percentage but scores them against the baseline, so a cross-run flip cannot move a delta. Regions are read from each revision's own source.

File Kind Lines Rev Reason
src/cli/drive/lease.rs ignore 418-422 both a sheet restore's fresh backup is always a DriveCopy — restore.rs's own recheck refuses unless the target is still a spreadsheet, and acquire() only ever takes a Bytes backup of a non-native target; this arm exists solely for exhaustiveness over the shared LeaseBackup enum
src/cli/drive/lease.rs ignore 1000-1003 both guards this test helper against misuse; every call site below passes an acquire subcommand
src/cli/drive/lease.rs ignore 1014-1017 both guards this test helper against misuse; every call site below passes a prune subcommand
src/drive/lease/ledger.rs ignore 812-816 both mutate_locked refuses before ever calling the closure, so its body never runs — a hit here is a regression, not a coverage gap
src/drive/lease/restore.rs ignore 1137-1141 both every test using this double refuses before authenticating; a hit here is a regression, not a coverage gap

Patch coverage

Patch: 93.02% (40/43 new lines covered)

File Patch Uncovered new lines
src/cli/drive/lease.rs 93.02% (40/43) 891-893
Uncovered new lines (3)
  • src/cli/drive/lease.rs:891
  • src/cli/drive/lease.rs:892
  • src/cli/drive/lease.rs:893

📦 Full per-file coverage summary · run summary

@newhoggy
newhoggy merged commit 6ea732b into main Sep 17, 2026
17 checks passed
@newhoggy
newhoggy deleted the issue-1695-settings-parse-warn branch September 17, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(drive): LeaseFlags::resolve silently drops biometrics_only when settings.json fails to parse

1 participant