-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
👍 Interceptor を追加 #120
👍 Interceptor を追加 #120
Conversation
Walkthroughビルド設定に関する変更がアプリケーション全体にわたって行われました。新しい Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 3
Configuration used: CodeRabbit UI
Files selected for processing (11)
- app/android/src/androidMain/kotlin/club/nito/app/AppModule.kt (1 hunks)
- app/android/src/androidMain/kotlin/club/nito/app/MainActivity.kt (1 hunks)
- app/ios-combined/src/commonMain/kotlin/club/nito/ios/combined/KmpEntryPoint.kt (2 hunks)
- app/ios/Modules/Sources/KmpContainer/Container.swift (2 hunks)
- app/shared/src/commonMain/kotlin/club/nito/app/shared/NitoApp.kt (2 hunks)
- core/model/src/commonMain/kotlin/club/nito/core/model/BuildConfig.kt (1 hunks)
- core/network/src/androidMain/kotlin/club/nito/core/network/SupabaseClient.android.kt (1 hunks)
- core/network/src/commonMain/kotlin/club/nito/core/network/SupabaseClient.kt (3 hunks)
- core/network/src/commonMain/kotlin/club/nito/core/network/di/SupabaseClientModule.kt (2 hunks)
- core/network/src/iosMain/kotlin/club/nito/core/network/SupabaseClient.ios.kt (1 hunks)
- core/network/src/jsMain/kotlin/club/nito/core/network/SupabaseClient.js.kt (1 hunks)
Additional comments: 17
app/android/src/androidMain/kotlin/club/nito/app/AppModule.kt (1)
- 7-13: このコードの変更は、
BuildConfig
のシングルトンインスタンスをappModule
を通じて提供しており、AppBuildConfig
からのプロパティを使用しています。問題は見受けられません。app/android/src/androidMain/kotlin/club/nito/app/MainActivity.kt (1)
- 36-44:
MainActivity
のsetContent
ブロック内にinitKoin
ブロックが追加されました。これにより、Koinの依存性注入フレームワークの初期化プロセスに変更が加えられたことが示唆されます。appModule
を使用してKoinを初期化することで、アプリケーションの依存関係グラフと制御フローに影響を与える可能性があります。この変更は、プルリクエストの目的に沿っており、レビューで特に指摘する問題は見受けられません。app/ios-combined/src/commonMain/kotlin/club/nito/ios/combined/KmpEntryPoint.kt (2)
23-24:
KmpEntryPoint
クラスのinit
関数にデフォルト値BuildConfig.Empty
を持つ新しいパラメータbuildConfig
が追加されました。この変更は、PRの目的と提供されたサマリーに沿っています。45-46:
startKoin
ブロックにBuildConfig
のシングルトンインスタンスを提供する新しいモジュールが追加されました。この変更もPRの目的と提供されたサマリーに一致しています。app/ios/Modules/Sources/KmpContainer/Container.swift (2)
6-13: 新しい
buildConfig
パラメーターをdoInit
メソッドに導入する変更は、PRの目的に合致しています。AppBuildConfig
インスタンスを作成して、ビルド設定に基づいてインターセプターを設定するために使用されます。24-37:
AppBuildConfig
クラスはBuildConfig
に準拠しており、コンパイルフラグに基づいてdebugBuild
を設定し、アプリのバンドル情報からversionName
を設定します。この変更は、ビルド設定をアプリケーションの他の部分で利用可能にするために重要です。app/shared/src/commonMain/kotlin/club/nito/app/shared/NitoApp.kt (3)
28-31: 新しいパラメータ
initKoin
がNitoApp
関数に追加されました。これにより、Koinの初期化をカスタマイズできるようになります。この変更が他のコンポーザブル関数の呼び出しに影響を与えないことを確認してください。55-55:
initKoin
関数がKoinApplication
ブロック内で呼び出されています。これは、Koinの設定をカスタマイズするための適切な場所です。29-30:
shouldKeepOnScreen
パラメータの順序が変更されています。これにより、関数のシグネチャが変更されたため、この関数を使用する既存のコードが影響を受ける可能性があります。この変更が意図的であること、および必要なすべての呼び出し場所が更新されていることを確認してください。core/network/src/androidMain/kotlin/club/nito/core/network/SupabaseClient.android.kt (1)
- 8-24: この実装は、デバッグビルドかどうかに基づいてログレベルを設定するために
buildConfig
パラメータを適切に使用しています。これにより、デバッグビルドの場合にはHTTPリクエストとレスポンスの内容がログに記録され、リリースビルドの場合にはログが無効になります。core/network/src/commonMain/kotlin/club/nito/core/network/SupabaseClient.kt (4)
3-4:
BuildConfig
のインポートが追加されています。これは、HTTPクライアントの設定に関連する変更を示している可能性があります。21-24:
createNitoSupabaseClient
関数にhttpClientEngine
パラメータが追加されましたが、このパラメータはnull許容型です。nullを許容することの意図された使用ケースを確認してください。41-41:
createHttpEngine
関数がexpect
キーワードで宣言されています。これはKotlin Multiplatformプロジェクトにおいて適切です。43-45:
NitoSettingsSessionManager
クラスはprivateであり、Settings
を使用したセッション管理のために正しく実装されているようです。core/network/src/commonMain/kotlin/club/nito/core/network/di/SupabaseClientModule.kt (2)
3-4: 新しいインポート文
import club.nito.core.network.createHttpEngine
が追加されました。これは、HTTPクライアントエンジンを作成するために必要です。13-21:
supabaseClientModule
に新しい引数httpClientEngine
が追加され、createHttpEngine(buildConfig = get())
を呼び出して作成されています。これにより、ビルド設定に基づいてHTTPクライアントエンジンが設定されます。core/network/src/jsMain/kotlin/club/nito/core/network/SupabaseClient.js.kt (1)
- 6-6: この
createHttpEngine
関数は、JavaScript環境用にnull
を返しています。これは意図的なのか、それとも実装が未完了なのかを確認してください。JavaScript環境ではインターセプターや特定のHTTPクライアントエンジンが適用されない、または必要ない場合がありますが、PRの説明やコードベースのドキュメントでこの挙動が意図されていることを確認することが重要です。
private object EmptyBuildConfig : BuildConfig { | ||
override val versionName: String = "" | ||
override val debugBuild: Boolean = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EmptyBuildConfig
がprivate
として宣言されていますが、これは他のモジュールからアクセスできないことを意味します。BuildConfig
のデフォルト実装として使用する場合は、public
に変更する必要があります。
- private object EmptyBuildConfig : BuildConfig {
+ public object EmptyBuildConfig : BuildConfig {
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
private object EmptyBuildConfig : BuildConfig { | |
override val versionName: String = "" | |
override val debugBuild: Boolean = false | |
} | |
public object EmptyBuildConfig : BuildConfig { | |
override val versionName: String = "" | |
override val debugBuild: Boolean = false | |
} |
import club.nito.core.model.BuildConfig | ||
import io.ktor.client.engine.HttpClientEngine | ||
|
||
internal actual fun createHttpEngine(buildConfig: BuildConfig): HttpClientEngine? = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOSのcreateHttpEngine
関数がnull
を返していますが、これは意図した動作ではない可能性があります。サマリーによると、この関数はBuildConfig
のdebugBuild
フラグに基づいてロギング用のインターセプターを設定してHttpClientEngine
を作成する必要があります。適切なHttpClientEngine
を設定して返すように実装を見直すことをお勧めします。
import kotlinx.serialization.encodeToString | ||
import kotlinx.serialization.json.Json | ||
|
||
internal fun createNitoSupabaseClient( | ||
httpClientEngine: HttpClientEngine?, | ||
json: Json, | ||
): SupabaseClient = createSupabaseClient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SupabaseのURLとキーがハードコードされています。キーが機密情報である場合、セキュリティ上の懸念があります。
Issue
概要
Interceptor を追加します。
レビュー観点
特になし
レビューレベル
レビュー優先度
参考リンク
スクリーンショット
Summary by CodeRabbit
新機能
BuildConfig
インターフェースを追加しました。バグ修正
initKoin
ブロックをMainActivity
に追加しました。ドキュメント
buildConfig
パラメータを導入しました。リファクタ
NitoApp
関数にinitKoin
パラメータを追加し、パラメータの順序を変更しました。スタイル
styles.css
に追加しました。テスト
createHttpEngine
関数を追加しました。チョア
リバート