From e811b4bc43aa6b4ef276f4c59924f569fc6a462b Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 7 Jul 2026 23:18:10 +0200 Subject: [PATCH] Limit confirmed route actions in driver projection --- app/build.gradle.kts | 2 +- .../pl/firmatpp/kierowca/data/upload/RouteActionDao.kt | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e2dee25..a4946ce 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -34,7 +34,7 @@ android { applicationId = "pl.firmatpp.kierowca" minSdk = 26 targetSdk = 35 - versionCode = 48 + versionCode = 49 versionName = "1.0.44" setProperty("archivesBaseName", "pl.firmatpp.kierowca") testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/pl/firmatpp/kierowca/data/upload/RouteActionDao.kt b/app/src/main/java/pl/firmatpp/kierowca/data/upload/RouteActionDao.kt index 14d3c30..46c3d05 100644 --- a/app/src/main/java/pl/firmatpp/kierowca/data/upload/RouteActionDao.kt +++ b/app/src/main/java/pl/firmatpp/kierowca/data/upload/RouteActionDao.kt @@ -27,7 +27,15 @@ interface RouteActionDao { @Query( """ SELECT * FROM route_actions - WHERE status IN ('PENDING', 'WAITING_FOR_PHOTOS', 'SYNCING', 'CONFIRMED', 'FAILED_RETRYABLE', 'FAILED_CONFLICT', 'FAILED_PERMANENT') + WHERE status IN ('PENDING', 'WAITING_FOR_PHOTOS', 'SYNCING', 'FAILED_RETRYABLE', 'FAILED_CONFLICT', 'FAILED_PERMANENT') + OR clientActionId IN ( + SELECT confirmed.clientActionId + FROM route_actions AS confirmed + WHERE confirmed.status = 'CONFIRMED' + AND confirmed.routeId = route_actions.routeId + ORDER BY confirmed.createdAtEpochMillis DESC + LIMIT 2 + ) ORDER BY createdAtEpochMillis DESC """, )