Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

chore: small cleanups from the 2026-09 code review (checklist)

Đang mở
#302 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, csharp, sqlite
Lĩnh vực
backend

Hướng nghiên cứu

The checklist names entry points across the project, including App.axaml.cs, MainActivity.OnPause, SystemAlarmService.cs, IncidentFile.SanitizeFileName, and DispatcherTimerTicker; read the relevant unchecked item and its referenced code first. Several items involve concurrency, lifecycle, security, or cancellation across subsystems, so select a narrowly scoped item and check whether it has already been split into another issue. Done means the chosen item is implemented and its behavior is covered by appropriate tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

From the 2026-09-09 code review of main (35d86e1). Small, independent items; each is a short PR. Tick them off here.

  • Four copy-paste JSON stores (JsonRecentFilesStore, JsonLastSaveFolderStore, JsonLastPdfExportStore in AppLogic, JsonTrustStore in Sync) repeat the same read/deserialise/catch (JsonException)/write scaffolding. Extract one generic JsonFileStore<T> with the atomic temp+rename write that #286 added to the trust store. — #329
  • JsonTrustStore.Persist() mutates _cache before the disk write; if File.Move throws, memory and disk diverge until the next write. Write first, then commit the in-memory change (noted in the #286 review). — #331
  • AboutViewModel.cs:68-77 and LinksViewModel.cs:103-112 are byte-identical OpenUrlAsync try/catch blocks; share one helper (also listed in #167 as "URL validation + opening duplicated"). — #332
  • RemoteIncidentSession.cs:496-501: a three-line comment block is duplicated verbatim. — #331
  • TasksSection.cs:54 (PDF) uses DateTimeOffset.Now to render "overdue", so the same incident exports differently depending on wall-clock time and the section is untestable. Pass the IClock (or an explicit "as of" timestamp) into the report. — #334
  • ForceUnit.Status and RoleAssignment.Role are free strings validated against nothing; Incident.StatusChangeText (:666) switches on the string, so a typo in master data silently falls through. Validate against MasterDataSet at the session boundary, or model status as a small value type. — #355
  • App.CreateMainViewModel (App.axaml.cs:25) is a mutable public static delegate, a service-locator seam in an otherwise constructor-injected design. Pass the factory into App explicitly.
  • MainView.axaml.cs:19-32 re-attaches PropertyChanged/Cancelled/… handlers to every new PendingPrompt without detaching from the previous one. Same shape in IncidentWorkspaceView.axaml.cs:38,45. — #371
  • MainActivity.OnPause fires _ = _store?.FlushAsync() without awaiting; the last save can be lost when Android kills the process. Block briefly (with a timeout) as the desktop Exit handler does.
  • SystemAlarmService is never disposed on Android, so its temp WAV files leak.
  • SystemAlarmService._voiceTempFiles is an unsynchronized Dictionary written by TempFileFor on SerialAudioQueue's worker thread (SystemAlarmService.cs:107-125, reached from PlayBlocking :80) and enumerated by Dispose on the UI thread at exit (:152) — a cue in flight during shutdown enumerates while the other thread mutates. Same class as the DispatcherTimerTicker item below, but unlike that one this is genuinely cross-thread. While there: the temp path is a fixed lagebuch-{sound}.wav in the world-writable system temp dir (:116), with none of the per-open GUID directory and symlink refusal AttachmentTempPaths gives attachments — another local user can pre-create or symlink that path. (Found re-auditing #167.)
  • No CancellationTokenSource exists anywhere in src/; tokens are only forwarded. A slow join, a large upload or a long PDF export cannot be cancelled by the user. Wire a cancel button on the join and export flows to a real CTS.
  • IncidentFile.SanitizeFileName (#285) strips control characters but not Unicode format characters (e.g. U+202E RLO), so a display-name spoof is still possible in the Dateien list. Strip UnicodeCategory.Format too.
  • DispatcherTimerTicker allocates _subscribers.ToArray() on every tick and a throwing subscriber aborts the rest of the tick on the UI thread; isolate subscribers (also listed in #167).
  • RemoteIncidentSession's per-device attachment cache under attachment-cache/ is never evicted (also listed in #167). — split out as #382, tracked there.
  • HttpClientHandler created in RemoteIncidentSession is now disposed (#286); check SystemAlarmService._voiceTempFiles and PdfLicense._configured static state for testability while there.
Ngôn ngữ chính
C#
Star
1
Fork
3
Merge trung bình
4 giờ 49 phút
Pull request đã merge (30 ngày)
177

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CodeForFire/lagebuch

Tất cả issue của CodeForFire/lagebuch

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.