Skip to content

feat: EventBusをKotlin Flows + SharedFlowに移行#27

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1759137518-eventbus-migration
Open

feat: EventBusをKotlin Flows + SharedFlowに移行#27
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1759137518-eventbus-migration

Conversation

@devin-ai-integration
Copy link

feat: EventBusをKotlin Flows + SharedFlowに移行

Summary

GreenRobot EventBusからKotlin Flows + SharedFlowベースの実装に完全移行しました。既存のEventBusインターフェースを維持し、@Subscribeアノテーションの互換性を保つことで破壊的変更を回避しています。

主な変更:

  • EventBusImpl: SharedFlowとCoroutineScopeを使用した新実装
  • カスタム@Subscribe/ThreadModeアノテーション実装
  • リフレクションベースの購読者自動検出
  • GreenRobot EventBus依存関係の削除
  • ProGuardルールの更新

Review & Testing Checklist for Human

⚠️ 高リスクな変更のため、以下の5項目の入念なテストが必須です:

  • イベント配信の動作確認: バーコードスキャン、商品追加、決済完了など各種イベント(BarcodeEvent, SystemEvent)が正常に配信されることを実機で確認
  • メモリリーク検証: ViewModelのライフサイクル(register/unregister)が正常に動作し、メモリリークが発生しないことを確認
  • リフレクション動作確認: すべての@Subscribeメソッドが正常に検出・実行されることを確認(特にItemListViewModel, MainViewModelの各ハンドラー)
  • Android 7デバイステスト: 要件であるAndroid 7での動作確認(エミュレータ・実機両方)
  • パフォーマンス影響確認: リフレクションベース実装による性能劣化がないことを確認

推奨テストプラン:

  1. アプリ起動→各画面遷移→バーコード読取→商品追加→決済の一連フローを実行
  2. 複数回のViewModel生成・破棄を行いメモリ使用量を監視
  3. Android 7デバイスで上記フローを実行

Notes

  • アーキテクチャ変更: 外部ライブラリから自作実装への完全移行
  • リフレクション使用: パフォーマンスとセキュリティへの影響要注意
  • コルーチン管理: Job cancellationの適切な実装を確認済み

Link to Devin run: https://app.devin.ai/sessions/e8db403c6a7f489e98587b21afcb7330
Requested by: @Atsumi3

- GreenRobot EventBusからKotlin Flows + SharedFlowベースの実装に置き換え
- 既存のEventBusインターフェースを維持し、破壊的変更を回避
- @subscribeアノテーションとリフレクションベースの自動検出を実装
- Android 7互換性を維持
- 依存関係からeventbusライブラリを削除
- ProGuardルールを新しい実装に対応

変更内容:
- EventBusImpl: SharedFlowとCoroutineScopeを使用した新実装
- Subscribe/ThreadModeアノテーション: 独自実装で互換性維持
- ViewModels: importを新しいアノテーションに更新
- build.gradle: eventbus依存関係を削除
- proguard-rules.pro: 新しいアノテーション用ルールに更新

Co-Authored-By: Atsumi3 <atsumi@mail.bizen.jp>
@devin-ai-integration
Copy link
Author

Prompt hidden (unlisted session)

@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants