chore: small cleanups from the 2026-09 code review (checklist)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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,JsonLastPdfExportStorein AppLogic,JsonTrustStorein Sync) repeat the same read/deserialise/catch (JsonException)/write scaffolding. Extract one genericJsonFileStore<T>with the atomic temp+rename write that #286 added to the trust store. — #329 -
JsonTrustStore.Persist()mutates_cachebefore the disk write; ifFile.Movethrows, 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-77andLinksViewModel.cs:103-112are byte-identicalOpenUrlAsynctry/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) usesDateTimeOffset.Nowto render "overdue", so the same incident exports differently depending on wall-clock time and the section is untestable. Pass theIClock(or an explicit "as of" timestamp) into the report. — #334 -
ForceUnit.StatusandRoleAssignment.Roleare free strings validated against nothing;Incident.StatusChangeText(:666) switches on the string, so a typo in master data silently falls through. Validate againstMasterDataSetat 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 intoAppexplicitly. -
MainView.axaml.cs:19-32re-attachesPropertyChanged/Cancelled/… handlers to every newPendingPromptwithout detaching from the previous one. Same shape inIncidentWorkspaceView.axaml.cs:38,45. — #371 -
MainActivity.OnPausefires_ = _store?.FlushAsync()without awaiting; the last save can be lost when Android kills the process. Block briefly (with a timeout) as the desktopExithandler does. -
SystemAlarmServiceis never disposed on Android, so its temp WAV files leak. -
SystemAlarmService._voiceTempFilesis an unsynchronizedDictionarywritten byTempFileForonSerialAudioQueue's worker thread (SystemAlarmService.cs:107-125, reached fromPlayBlocking:80) and enumerated byDisposeon the UI thread at exit (:152) — a cue in flight during shutdown enumerates while the other thread mutates. Same class as theDispatcherTimerTickeritem below, but unlike that one this is genuinely cross-thread. While there: the temp path is a fixedlagebuch-{sound}.wavin the world-writable system temp dir (:116), with none of the per-open GUID directory and symlink refusalAttachmentTempPathsgives attachments — another local user can pre-create or symlink that path. (Found re-auditing #167.) - No
CancellationTokenSourceexists anywhere insrc/; 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. StripUnicodeCategory.Formattoo. -
DispatcherTimerTickerallocates_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 underattachment-cache/is never evicted (also listed in #167). — split out as #382, tracked there. -
HttpClientHandlercreated inRemoteIncidentSessionis now disposed (#286); checkSystemAlarmService._voiceTempFilesandPdfLicense._configuredstatic state for testability while there.
- 主要语言
- C#
- 星标
- 1
- 派生
- 3
- 平均合并
- 4 小时 49 分钟
- 30 天内合并 PR
- 177
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CodeForFire/lagebuch 的其他 Issue
-
Stammdaten: in the Checkliste editor the PFLICHT header is not aligned with its column可能已有人在做 @Saad-elnagar 于 1 天前认领。 未关闭bug ux
难度 2/5 1-3 小时 新手友好度 78/100
CodeForFire/lagebuch#714 · 1 条评论 ·
维护者通常 1 天内回复
-
Stammdaten: on a phone the Fahrzeuge editor squeezes Wache and Funkrufname to nothing可能已有人在做 @Saad-elnagar 于 1 天前认领。 未关闭bug ux
难度 2/5 1-3 小时 新手友好度 75/100
CodeForFire/lagebuch#713 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
CodeForFire/lagebuch#405 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
CodeForFire/lagebuch#349 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
CodeForFire/lagebuch#348 ·
维护者通常 1 天内回复
查看 CodeForFire/lagebuch 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
-
[Bug]: Revit selector reads process ids 2000-2099 as years (flaky AgentClientTests.AYearOrAProcessIdSelectsTheHost)可能已有人在做 @Wurschdhaud 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
pyrevitlabs/pyRevit#3817 ·
维护者通常 1 天内回复
-
bug effort:S P2
难度 2/5 1-3 小时 新手友好度 76/100
nightscout/nocturne#2449 ·
维护者通常 1 天内回复
-
audit:1 bug
难度 2/5 1-3 小时 新手友好度 76/100
NethermindEth/dotnet-libp2p#395 ·
维护者通常 1 天内回复
-
area: client bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复