Skip to content

LegacyMigratorの複数バグを修正#32

Draft
yuu1111 wants to merge 3 commits intoTeamFelNull:mainfrom
yuu1111:fix/legacy-migration-bugs
Draft

LegacyMigratorの複数バグを修正#32
yuu1111 wants to merge 3 commits intoTeamFelNull:mainfrom
yuu1111:fix/legacy-migration-bugs

Conversation

@yuu1111
Copy link
Contributor

@yuu1111 yuu1111 commented Feb 12, 2026

Summary

  • migrateServerUserData() で userId にサーバーIDが代入される致命的バグを修正
  • loadJson()JsonSyntaxException の未捕捉と空JSONファイル時の NPE を修正
  • 辞書マイグレーションを冪等化し、中断後の再実行による二重登録を防止
  • ファイル移動処理を改善し、部分的失敗時のデータ整合性を確保

Test plan

  • ./gradlew build でビルド成功を確認
  • ./gradlew test でテスト通過を確認
  • 旧JSON形式の保存データを用意し、マイグレーションが正しく動作することを確認
  • マイグレーションを途中で中断し、再実行で正しい最終状態に収束することを確認

- userId にサーバーIDが代入される致命的バグを修正 (entry.getKey()を使用)
- loadJson()でJsonSyntaxExceptionを捕捉し、空JSONファイルのNPEを防止
- 辞書マイグレーションを冪等化し、再実行時の二重登録を防止
- ファイル移動処理を改善し、部分的失敗時の整合性を確保
- パッケージプライベートコンストラクタとインスタンスフィールドでパス注入可能に
- ファイル移動ロジックをmoveOldData()に切り出し
- 全バグ修正をカバーするテストケースを追加
- ディレクトリ未存在時のスキップ
- 不正ファイル名のスキップ
- 不正ユーザーIDのスキップ
- 未対応バージョンのスキップ
- dataキー欠落時のスキップ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments