TUI saved form: 0600 mode and corrupt-file fallback have no test
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
Hướng nghiên cứu
Đọc internal/tui/config.go và các bài kiểm thử cấu hình hiện có trong internal/tui/config_test.go. Thêm bài kiểm thử cho chế độ tệp trên hệ điều hành không phải Windows sau saveConfig và cho trường hợp JSON bị hỏng khiến chương trình dùng các giá trị mặc định thông qua loadSavedConfig và New(). Chạy go test ./internal/tui/ -run Config; hoàn tất khi cả hai tiêu chí chấp nhận đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The TUI's saved form (last.json) is written with mode 0600 on purpose, and corrupt files are meant to fall back to defaults. Neither behaviour has a test.
Where
internal/tui/config.go:62-75(loadSavedConfig; thejson.Unmarshalfailure branch has 0 hits)internal/tui/config.go:91-99(saveConfig: "so the file is 0600 whatever the umask")internal/tui/config_test.go:174-176(only the missing-file case is tested)
Details
saveConfig deliberately avoids output.WriteFile, because the saved form can name the user's files and resolvers. No TUI test checks the file mode: there is no Mode() or Perm anywhere in internal/tui/*_test.go. saveConfig is at 60% coverage.
Impact
A refactor back to output.WriteFile, which the code comment warns against, would quietly make last.json world-readable on Unix, and no test would catch it. A corrupt or half-written last.json is untested input at startup.
Suggested fix
Add the two tests below.
Acceptance criteria
- On non-Windows, with a permissive umask set for the test,
os.Stat(configPath())aftersaveConfigreports0o600 - With
{"domain":written tolast.json,loadSavedConfigreturnsok=falseandNew()starts with the default form without panicking
Getting started
- Relevant files:
internal/tui/config.go,internal/tui/config_test.go - How to run tests:
go test ./internal/tui/ -run Config
Filed by repo-audit/full-audit at dd5b156. Severity: low. Effort: S. audit-key: testing|internal/tui/config.go|saveConfig
- Ngôn ngữ chính
- Go
- Star
- 1
- Fork
- 1
- Merge trung bình
- 7 giờ 18 phút
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/subenum
-
severity: low tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/subenum#414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue severity: low testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
TMHSDigital/subenum#412 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue performance severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/subenum#411 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug github-actions good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/subenum#407 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: cli severity: medium tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
TMHSDigital/subenum#402 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/subenum
Issue tương tự
-
area/api integration/inbound
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
go-vikunja/vikunja#4446 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Additional underlay with a different id than the channel owner is acceptedCó thể đã có người làm @dmuensterer đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
stacklok/toolhive-catalog#1976 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
projectdiscovery/nuclei#8159 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MemoryStore.GetConversationChain logs while holding the store read lock, stalling every writerĐang mởneeds-acceptance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
vllm-project/semantic-router#6785 ·
Maintainer thường phản hồi trong vòng 1 ngày