From 0ae330ef2ae5d387f81b1907d4a31d9a4c3edbf0 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Wed, 4 Mar 2026 17:57:07 +0100 Subject: [PATCH 1/4] fix: remove app from recents on close Co-Authored-By: Claude Opus 4.6 --- .../to/bitkit/androidServices/LightningNodeService.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/to/bitkit/androidServices/LightningNodeService.kt b/app/src/main/java/to/bitkit/androidServices/LightningNodeService.kt index 084093db6..22a1a88a7 100644 --- a/app/src/main/java/to/bitkit/androidServices/LightningNodeService.kt +++ b/app/src/main/java/to/bitkit/androidServices/LightningNodeService.kt @@ -1,5 +1,6 @@ package to.bitkit.androidServices +import android.app.ActivityManager import android.app.Notification import android.app.PendingIntent import android.app.Service @@ -133,10 +134,12 @@ class LightningNodeService : Service() { when (intent?.action) { ACTION_STOP_SERVICE_AND_APP -> { Logger.debug("ACTION_STOP_SERVICE_AND_APP detected", context = TAG) - // Close activities gracefully without force-stopping the app - App.currentActivity?.value?.finishAffinity() - // Stop the service - stopSelf() + serviceScope.launch { + lightningRepo.stop() + val activityManager = getSystemService(ACTIVITY_SERVICE) as ActivityManager + activityManager.appTasks.forEach { it.finishAndRemoveTask() } + stopSelf() + } return START_NOT_STICKY } } From 77cde5adfaef4d67d330fcd77e97d4f299b05d68 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Wed, 4 Mar 2026 20:38:42 +0100 Subject: [PATCH 2/4] fix: remove scope cancel race --- .../to/bitkit/androidServices/LightningNodeService.kt | 10 +++------- app/src/main/java/to/bitkit/ext/Context.kt | 4 ++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/to/bitkit/androidServices/LightningNodeService.kt b/app/src/main/java/to/bitkit/androidServices/LightningNodeService.kt index 22a1a88a7..4e35ed4d2 100644 --- a/app/src/main/java/to/bitkit/androidServices/LightningNodeService.kt +++ b/app/src/main/java/to/bitkit/androidServices/LightningNodeService.kt @@ -1,6 +1,5 @@ package to.bitkit.androidServices -import android.app.ActivityManager import android.app.Notification import android.app.PendingIntent import android.app.Service @@ -14,7 +13,6 @@ import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import org.lightningdevkit.ldknode.Event import to.bitkit.App @@ -23,6 +21,7 @@ import to.bitkit.data.CacheStore import to.bitkit.di.UiDispatcher import to.bitkit.domain.commands.NotifyPaymentReceived import to.bitkit.domain.commands.NotifyPaymentReceivedHandler +import to.bitkit.ext.activityManager import to.bitkit.models.NewTransactionSheetDetails import to.bitkit.models.NotificationDetails import to.bitkit.repositories.LightningRepo @@ -136,7 +135,6 @@ class LightningNodeService : Service() { Logger.debug("ACTION_STOP_SERVICE_AND_APP detected", context = TAG) serviceScope.launch { lightningRepo.stop() - val activityManager = getSystemService(ACTIVITY_SERVICE) as ActivityManager activityManager.appTasks.forEach { it.finishAndRemoveTask() } stopSelf() } @@ -148,10 +146,8 @@ class LightningNodeService : Service() { override fun onDestroy() { Logger.debug("onDestroy", context = TAG) - serviceScope.launch { - lightningRepo.stop() - serviceScope.cancel() - } + // Safe to call even if already stopped — guarded by lifecycleMutex + isStoppedOrStopping() + serviceScope.launch { lightningRepo.stop() } super.onDestroy() } diff --git a/app/src/main/java/to/bitkit/ext/Context.kt b/app/src/main/java/to/bitkit/ext/Context.kt index ae11b3989..388557d96 100644 --- a/app/src/main/java/to/bitkit/ext/Context.kt +++ b/app/src/main/java/to/bitkit/ext/Context.kt @@ -1,6 +1,7 @@ package to.bitkit.ext import android.app.Activity +import android.app.ActivityManager import android.app.NotificationManager import android.content.ClipData import android.content.ClipboardManager @@ -27,6 +28,9 @@ val Context.notificationManagerCompat: NotificationManagerCompat val Context.clipboardManager: ClipboardManager get() = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager +val Context.activityManager: ActivityManager + get() = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager + // Permissions fun Context.requiresPermission(permission: String): Boolean = From cada0f973e36133bb1617e0c5ef518cfa7225df2 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Wed, 4 Mar 2026 22:23:52 +0100 Subject: [PATCH 3/4] fix: claude code review not posting comments Co-Authored-By: Claude Opus 4.6 --- .github/workflows/claude-code-review.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 1cf0d61c4..8bcdd9331 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -62,6 +62,6 @@ jobs: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' - prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' - # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md - # or https://code.claude.com/docs/en/cli-reference for available options + prompt: '/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' + claude_args: | + --allowedTools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api:*),Bash(git log:*),Bash(git diff:*),Bash(git blame:*),Read,Glob,Grep" From 63dd1afc691cc662593edfb008c66d656f9ed857 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Thu, 5 Mar 2026 01:00:21 +0100 Subject: [PATCH 4/4] chore: update ldk-node to v0.7.0-rc.32 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 13165c7cd..f78fafcf0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -58,7 +58,7 @@ ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" } ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" } ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } -ldk-node-android = { module = "com.synonym:ldk-node-android", version = "0.7.0-rc.31" } +ldk-node-android = { module = "com.synonym:ldk-node-android", version = "0.7.0-rc.32" } lifecycle-process = { group = "androidx.lifecycle", name = "lifecycle-process", version.ref = "lifecycle" } lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycle" } lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" }