From cd59bffe5180f5ac752a809856c3eb66f6c321d2 Mon Sep 17 00:00:00 2001 From: Ephraim Kigamba Date: Thu, 12 Jan 2023 18:59:31 +0300 Subject: [PATCH 1/7] Add F_ZEIR_ID to duplicate ids fix --- .gitignore | 1 + gradle.properties | 2 +- .../java/org/smartregister/account/AccountAuthenticator.java | 2 -- .../org/smartregister/repository/EventClientRepository.java | 4 ++++ .../org/smartregister/repository/ZeirIdCleanupRepository.java | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ccd183882..bd85572d7 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ opensrp-path/fabric.properties opensrp-path/reports/ opensrp-core/reports/ opensrp-core/jacoco.exec +robolectric-deps/ diff --git a/gradle.properties b/gradle.properties index 5f0308c43..b62201fe4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=5.0.9-SNAPSHOT +VERSION_NAME=5.0.14-LOCAL-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Core Application diff --git a/opensrp-core/src/main/java/org/smartregister/account/AccountAuthenticator.java b/opensrp-core/src/main/java/org/smartregister/account/AccountAuthenticator.java index 0a3dcbb98..4ca4186b0 100644 --- a/opensrp-core/src/main/java/org/smartregister/account/AccountAuthenticator.java +++ b/opensrp-core/src/main/java/org/smartregister/account/AccountAuthenticator.java @@ -31,7 +31,6 @@ public AccountAuthenticator(Context context) { @Override public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException { - final Intent intent = new Intent(mContext, CoreLibrary.getInstance().getSyncConfiguration().getAuthenticationActivity()); intent.putExtra(AccountHelper.INTENT_KEY.ACCOUNT_TYPE, accountType); intent.putExtra(AccountHelper.INTENT_KEY.AUTH_TYPE, authTokenType); @@ -122,7 +121,6 @@ public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account @Override public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException { - final Intent intent = new Intent(mContext, CoreLibrary.getInstance().getSyncConfiguration().getAuthenticationActivity()); intent.putExtra(AccountHelper.INTENT_KEY.AUTH_TYPE, authTokenType); intent.putExtra(AccountHelper.INTENT_KEY.IS_NEW_ACCOUNT, false); diff --git a/opensrp-core/src/main/java/org/smartregister/repository/EventClientRepository.java b/opensrp-core/src/main/java/org/smartregister/repository/EventClientRepository.java index 1052cfdf9..204bde0dc 100644 --- a/opensrp-core/src/main/java/org/smartregister/repository/EventClientRepository.java +++ b/opensrp-core/src/main/java/org/smartregister/repository/EventClientRepository.java @@ -2424,6 +2424,10 @@ public DuplicateZeirIdStatus cleanDuplicateMotherIds(String[] eventTypes) throws identifierLabel = "M_ZEIR_ID"; } else if (identifiers.has("ANC_ID")) { identifierLabel = "ANC_ID"; + } else if (identifiers.has("ANC_ID")) { + identifierLabel = "ANC_ID"; + } else if (identifiers.has("F_ZEIR_ID")) { + identifierLabel = "F_ZEIR_ID"; } identifiers.put(identifierLabel, newZeirId.replaceAll("-", "")); diff --git a/opensrp-core/src/main/java/org/smartregister/repository/ZeirIdCleanupRepository.java b/opensrp-core/src/main/java/org/smartregister/repository/ZeirIdCleanupRepository.java index 0d22e9a05..e5a827d33 100644 --- a/opensrp-core/src/main/java/org/smartregister/repository/ZeirIdCleanupRepository.java +++ b/opensrp-core/src/main/java/org/smartregister/repository/ZeirIdCleanupRepository.java @@ -16,7 +16,7 @@ public class ZeirIdCleanupRepository extends BaseRepository { private static final String DUPLICATES_SQL = "WITH duplicates AS ( " + " WITH clients AS ( " + - " SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), json_extract(json, '$.identifiers.M_ZEIR_ID'), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_ID')) zeir_id " + + " SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), REPLACE(json_extract(json, '$.identifiers.M_ZEIR_ID'), '-', ''), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_ID'), REPLACE(json_extract(json, '$.identifiers.F_ZEIR_ID'), '-', '')) zeir_id " + " FROM client " + " ) " + " SELECT b.* FROM (SELECT baseEntityId, zeir_id FROM clients GROUP BY zeir_id HAVING count(zeir_id) > 1) a " + From a9ddc8d992d50b81dc7576729a1b485d2543a808 Mon Sep 17 00:00:00 2001 From: Ephraim Kigamba Date: Fri, 13 Jan 2023 16:05:41 +0300 Subject: [PATCH 2/7] Fix EventClientRepositoryTest failing test --- .../org/smartregister/repository/EventClientRepositoryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opensrp-core/src/test/java/org/smartregister/repository/EventClientRepositoryTest.java b/opensrp-core/src/test/java/org/smartregister/repository/EventClientRepositoryTest.java index 9c9523b39..5ddbef240 100644 --- a/opensrp-core/src/test/java/org/smartregister/repository/EventClientRepositoryTest.java +++ b/opensrp-core/src/test/java/org/smartregister/repository/EventClientRepositoryTest.java @@ -748,7 +748,7 @@ public MatrixCursor getCursorMaxRowId() { public void testCleanDuplicateMotherIdsShouldFixAndMarkDuplicateClientsUnSynced() throws Exception { String DUPLICATES_SQL = "WITH duplicates AS ( " + " WITH clients AS ( " + - " SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), json_extract(json, '$.identifiers.M_ZEIR_ID'), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_ID')) zeir_id " + + " SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), REPLACE(json_extract(json, '$.identifiers.M_ZEIR_ID'), '-', ''), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_ID'), REPLACE(json_extract(json, '$.identifiers.F_ZEIR_ID'), '-', '')) zeir_id " + " FROM client " + " ) " + " SELECT b.* FROM (SELECT baseEntityId, zeir_id FROM clients GROUP BY zeir_id HAVING count(zeir_id) > 1) a " + From 680f684b89e71a658d572dd0aa2da06a60a6bfc2 Mon Sep 17 00:00:00 2001 From: Ephraim Kigamba Date: Tue, 17 Jan 2023 13:44:51 +0300 Subject: [PATCH 3/7] :arrow-up: Bump version name to 5.0.10-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index b62201fe4..ade16f7ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=5.0.14-LOCAL-SNAPSHOT +VERSION_NAME=5.0.10-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Core Application From b06faac449dad591d15c5bb6d7284a737a8135fa Mon Sep 17 00:00:00 2001 From: vend Date: Tue, 14 Feb 2023 10:54:48 +0500 Subject: [PATCH 4/7] updated changes to be compatible in android to 31 --- build.gradle | 4 ++-- opensrp-core/build.gradle | 7 +++++-- sample/src/main/AndroidManifest.xml | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 31af54615..db7644dac 100644 --- a/build.gradle +++ b/build.gradle @@ -41,8 +41,8 @@ subprojects { ext.androidToolsBuildGradle = '4.0.0' ext.androidBuildToolsVersion = '29.0.3' ext.androidMinSdkVersion = 18 - ext.androidCompileSdkVersion = 29 - ext.androidTargetSdkVersion = 29 + ext.androidCompileSdkVersion = 31 + ext.androidTargetSdkVersion = 31 ext.androidAnnotationsVersion = '3.0.1' ext.androidAnnotationsAPIVersion = '3.0.1' diff --git a/opensrp-core/build.gradle b/opensrp-core/build.gradle index 0f8dac8ce..81831e58e 100644 --- a/opensrp-core/build.gradle +++ b/opensrp-core/build.gradle @@ -162,6 +162,7 @@ afterEvaluate { } configurations.all { resolutionStrategy.force 'commons-codec:commons-codec:1.10' + exclude group: 'com.evernote', module: 'android-job' } dependencies { @@ -172,7 +173,9 @@ dependencies { implementation 'org.codehaus.jackson:jackson-core-asl:1.9.13' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation "org.apache.httpcomponents:httpmime:4.5.6" + implementation ("org.apache.httpcomponents:httpmime:4.5.11"){ + exclude group: 'org.apache.httpcomponents', module: 'httpclient' + } implementation group: 'commons-codec', name: 'commons-codec', version: '1.10' implementation group: 'com.google.guava', name: 'guava', version: '24.1-jre' implementation group: 'commons-io', name: 'commons-io', version: '2.4' @@ -210,7 +213,7 @@ dependencies { exclude group: 'com.android.support', module: 'recyclerview-v7' } - implementation('com.evernote:android-job:1.2.6') { + implementation('com.github.devv911:android-job:1.4.5') { exclude group: 'com.google.android', module: 'android' } diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index b10bfcf21..9937303f4 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -18,7 +18,8 @@ + android:theme="@style/AppTheme.NoActionBar" + android:exported="true"> From 00635e83842f19691e2d19e7c2c5af90f3dc1718 Mon Sep 17 00:00:00 2001 From: Ephraim Kigamba Date: Tue, 28 Feb 2023 10:28:56 +0300 Subject: [PATCH 5/7] :arrow-up: Update core to 5.0.15-UNICEFTUNISIA-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ade16f7ef..4ef04a97e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=5.0.10-SNAPSHOT +VERSION_NAME=5.0.15-UNICEFTUNISIA-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Core Application From bb826b3c6411180d4c473c271dbb122244df2252 Mon Sep 17 00:00:00 2001 From: Ephraim Kigamba Date: Tue, 28 Feb 2023 10:25:34 +0300 Subject: [PATCH 6/7] Support opensrp_id used in CHW apps --- .../org/smartregister/repository/ZeirIdCleanupRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opensrp-core/src/main/java/org/smartregister/repository/ZeirIdCleanupRepository.java b/opensrp-core/src/main/java/org/smartregister/repository/ZeirIdCleanupRepository.java index e5a827d33..3fac2b490 100644 --- a/opensrp-core/src/main/java/org/smartregister/repository/ZeirIdCleanupRepository.java +++ b/opensrp-core/src/main/java/org/smartregister/repository/ZeirIdCleanupRepository.java @@ -16,7 +16,7 @@ public class ZeirIdCleanupRepository extends BaseRepository { private static final String DUPLICATES_SQL = "WITH duplicates AS ( " + " WITH clients AS ( " + - " SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), REPLACE(json_extract(json, '$.identifiers.M_ZEIR_ID'), '-', ''), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_ID'), REPLACE(json_extract(json, '$.identifiers.F_ZEIR_ID'), '-', '')) zeir_id " + + " SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), REPLACE(json_extract(json, '$.identifiers.M_ZEIR_ID'), '-', ''), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_ID'), REPLACE(json_extract(json, '$.identifiers.F_ZEIR_ID'), '-', ''), REPLACE(json_extract(json, '$.identifiers.opensrp_id'), '-', '')) zeir_id " + " FROM client " + " ) " + " SELECT b.* FROM (SELECT baseEntityId, zeir_id FROM clients GROUP BY zeir_id HAVING count(zeir_id) > 1) a " + From 7301b200e3b0ff2095c5a09e07730ab00566856a Mon Sep 17 00:00:00 2001 From: Ephraim Kigamba Date: Thu, 9 Mar 2023 12:04:36 +0300 Subject: [PATCH 7/7] :arrow-up: Update core to 5.1.2-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4ef04a97e..6c74d9c42 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=5.0.15-UNICEFTUNISIA-SNAPSHOT +VERSION_NAME=5.1.2-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Core Application