Skip to content

fix: fail closed on unknown privacy settings - #223

Open
seonghobae wants to merge 12 commits into
mainfrom
fix/privacy-settings-fail-closed-v1
Open

fix: fail closed on unknown privacy settings#223
seonghobae wants to merge 12 commits into
mainfrom
fix/privacy-settings-fail-closed-v1

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fail closed to DiskSage's offline privacy default when a persisted settings document contains an unknown/stale or structurally ambiguous online_mode value instead of silently preserving network authority.

Exact current state

  • Exact source head: 05651e03a63e2f81dc78c8aa7dfd1f678afce458.
  • Live protected main: be418bac9bfbdc8aa41b1a698713833e3dbccfdc.
  • PR is open, Draft, mergeable, and changes only src-tauri/src/settings.rs.
  • Exact-head native workflows all completed successfully: Test 31927075860, Release 31927075902, Security Scan 31927075863, and SAST Semgrep 31927075911.
  • Current review threads are empty. No qualifying formal approval exists on this head.
  • The live organization ruleset currently requires one independent approving review, approval after the last push, review-thread resolution, and the listed central required workflows. No older zero-approval snapshot is authoritative.

Test-first lineage

The branch first added a regression proving that {"online_mode":true,"unexpected_remote_setting":true} must fail closed to Settings::default() while production Serde still accepted unknown fields. The implementation then added only #[serde(deny_unknown_fields)] to Settings.

The current exact head adds regressions for two additional ambiguous-authority classes without changing production behavior:

  • duplicate online_mode keys fail closed rather than accepting one duplicate value;
  • null, numeric, and string representations of online_mode fail closed rather than being coerced into network authority.

Current production remains deliberately small: serde_json::from_str(json).unwrap_or_default() and a bool-only settings schema. Missing online_mode is valid and defaults offline; recognized explicit online_mode: true remains valid.

Security / compatibility boundary

  • Unknown or stale privacy settings cannot silently preserve network-enabled mode.
  • Duplicate or wrong-typed network-authority fields cannot be accepted ambiguously.
  • Corrupt JSON and empty input continue to fail closed offline.
  • The current serialized settings document remains unchanged.
  • This is strict schema admission, not a migration engine; future settings fields require deliberate schema and compatibility updates.

Current review evidence

CodeRabbit's most recent completed review of the implementation lineage reported no actionable comments for src-tauri/src/settings.rs; a later incremental review request was rate-limited and therefore is not qualifying approval evidence. Combined status currently includes CodeRabbit success, but status/model evidence is not an independent formal approval.

Remaining integration gates

Do not merge based on native green checks alone. Keep Draft until the unchanged exact head also satisfies every live central required workflow, the current one-approval/last-push rule, zero valid unresolved findings, fresh protected-main ancestry, and the repository-wide exact 100% owned-production region/statement-equivalent, branch, function, and line coverage contract owned by #156 without exclusions or threshold weakening. Pending, queued, skipped-required, neutral-required, failed, stale, predecessor, synthetic, diagnostic-only, status-only, model-only, author-only, rate-limited, no-source-scanner, or infrastructure-only evidence is not passing.

Summary by CodeRabbit

  • 버그 수정
    • 잘못된 필드나 중복 설정이 포함된 구성 데이터를 안전하게 기본 설정으로 처리합니다.
    • 불리언이 아닌 값이 입력된 경우에도 설정 로드 오류가 발생하지 않도록 개선했습니다.
    • 지원되지 않는 알 수 없는 설정 필드를 거부하도록 설정 데이터 검증을 강화했습니다.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 38 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e3b12d4-7e44-45b1-b97a-792e92153285

📥 Commits

Reviewing files that changed from the base of the PR and between 05651e0 and 51a934a.

📒 Files selected for processing (3)
  • .github/scripts/verify-release-artifacts.sh
  • .github/workflows/release.yml
  • src-tauri/src/settings.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c3c07f8-16b2-4637-b583-45055204e46a

📥 Commits

Reviewing files that changed from the base of the PR and between 8085fb3 and 05651e0.

📒 Files selected for processing (1)
  • src-tauri/src/settings.rs

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Settingsserde(deny_unknown_fields)를 추가했습니다. 알 수 없는 필드와 잘못된 online_mode 값은 Settings::default()로 처리됩니다. 해당 동작을 검증하는 테스트를 추가했습니다.

Changes

설정 검증

Layer / File(s) Summary
엄격한 Settings 역직렬화
src-tauri/src/settings.rs
Settings가 알 수 없는 JSON 필드를 거부합니다. 중복된 online_modenull, 숫자, 문자열 값을 포함한 입력은 기본 설정으로 처리되는지 테스트합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 05651

The change is localized to strict privacy-settings parsing and fails closed for unknown or ambiguous values; no actionable merge-blocking risk remains beyond normal required checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 알 수 없는 개인정보 설정을 거부하고 안전한 기본값으로 처리하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/privacy-settings-fail-closed-v1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as ready for review August 15, 2026 14:06
@seonghobae
seonghobae marked this pull request as draft August 15, 2026 20:06
@seonghobae
seonghobae marked this pull request as ready for review August 16, 2026 05:01
@seonghobae
seonghobae marked this pull request as draft August 16, 2026 10:29
@seonghobae
seonghobae marked this pull request as ready for review August 16, 2026 21:13
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@seonghobae
seonghobae marked this pull request as draft August 17, 2026 09:02
@seonghobae
seonghobae marked this pull request as ready for review August 18, 2026 00:06
@seonghobae
seonghobae marked this pull request as draft August 18, 2026 00:13
@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: draft Draft pull request type: bug Defect or incorrect behavior labels Aug 22, 2026
@seonghobae
seonghobae marked this pull request as ready for review August 24, 2026 05:25

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@seonghobae
seonghobae marked this pull request as draft August 24, 2026 06:12
@seonghobae
seonghobae marked this pull request as ready for review August 26, 2026 09:40
@seonghobae
seonghobae enabled auto-merge (squash) August 26, 2026 09:40

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Open in Devin Review

Comment on lines +58 to +62
require_exactly_one_path "$artifact_root/${expected_dirs[0]}/bundle/deb/*.deb" 'Debian bundle'
require_exactly_one_path "$artifact_root/${expected_dirs[0]}/bundle/appimage/*.AppImage" 'AppImage bundle'
require_exactly_one_path "$artifact_root/${expected_dirs[1]}/bundle/msi/*.msi" 'Windows MSI bundle'
require_exactly_one_path "$artifact_root/${expected_dirs[1]}/bundle/nsis/*.exe" 'Windows NSIS bundle'
require_exactly_one_path "$artifact_root/${expected_dirs[2]}/bundle/dmg/*.dmg" 'macOS DMG bundle'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Anchored path patterns tighten per-platform verification

require_exactly_one_path calls changed from unanchored globs to patterns anchored to specific expected_dirs (verify-release-artifacts.sh:58-62). Since find prints paths beginning with $artifact_root and the patterns are double-quoted, -path still matches. This scopes each bundle check to its platform directory — a tightening, not a regression.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +262 to +264
- name: Verify downloaded release artifact contract
shell: bash
run: bash .github/scripts/verify-release-artifacts.sh release-artifacts "${{ github.run_attempt }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Artifact counts stay consistent across the new verify step

The attest-release verify step runs before SBOM generation, where the script expects 17 files and 3 directories (6+6+5). The later inline checksum step expects 18, correctly counting the added disksage.spdx.json (release.yml:361). The windows-2022 directory matches the build matrix.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Normal-priority or P2 work status: draft Draft pull request type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant