Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Test coverage: JsonSyncable multi-client file fan-out and malformed-file tolerance

オープン
#100 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
58/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp
領域
testing

調査の方向性

まず既存の JsonSyncable テストを見つけ、src/SIL.Harmony/JsonSyncable.cs の、指定されているファイルのファンアウト、デシリアライズ、ClientIdForFile の各セクションを読みます。複数のクライアント、コンテンツのラウンドトリップ、空行または途中で切り詰められた行、解析できないクライアントファイル名を対象とする、提案されている4つのテストケースを追加し、その後、関連するテストスイートを実行してすべてのケースがパスすることを確認します。

索引モデルが issue の本文から書いたものです。

説明

enhancement

Follow-up from the test-suite review (batches merged as #92–#96). Existing JsonSyncable tests assert only file existence / line count and use a single client id, so the multi-client format behavior and error tolerance are untested.

Gaps

Per-client file fan-out — commits are grouped by ClientId into separate client_<id>.jsonl files, and GetSyncState aggregates heads across them. Every test uses one ClientId, so this is unexercised.

https://github.com/sillsdev/harmony/blob/03f609f11a560433ce4a7ecd598a21921b324add/src/SIL.Harmony/JsonSyncable.cs#L50-L78

Malformed / blank / truncated files — empty file yields nothing, blank lines are skipped, null deserialize is skipped. A crash mid-write leaves a truncated trailing line; no test confirms it is tolerated rather than making the whole client file unreadable.

https://github.com/sillsdev/harmony/blob/03f609f11a560433ce4a7ecd598a21921b324add/src/SIL.Harmony/JsonSyncable.cs#L116-L133

ClientIdForFile on a non-GUID filename — a stray client_*.jsonl with an unparseable id would throw from Guid.Parse inside the parallel loop; behavior is undefined by tests.

https://github.com/sillsdev/harmony/blob/03f609f11a560433ce4a7ecd598a21921b324add/src/SIL.Harmony/JsonSyncable.cs#L110-L114

Content round-trip — no test reads a commit back and verifies ChangeEntities / HybridDateTime / Metadata survived; a field-drop regression passes today.

Suggested tests

  • AddRange_MultipleClients_WritesSeparateFilesAndAggregatesSyncState
  • AddRangeThenGetChanges_RoundTripsCommitContent
  • ReadAllCommits_SkipsBlankLinesAndTruncatedTrailingLine
  • GetSyncState_IgnoresOrHandlesUnparseableClientFile

Why it matters

JSONL files are the on-disk sync format. Real projects have many clients (fan-out is load-bearing) and interrupted writes are expected in practice; today a serialization or truncation regression would go undetected.

主要言語
C#
スター
14
フォーク
4
平均マージ
5日 4時間
マージ済み PR(30日)
12

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sillsdev/harmony のほかの issue

sillsdev/harmony の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。