From 69e0166b0b75bf86559571a9f3f389c3f83fa20a Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Wed, 14 Aug 2024 11:31:21 +0300 Subject: [PATCH 1/5] fix: upload plugin --- .../ly/count/android/plugins/uploadSymbols.groovy | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/upload-plugin/src/main/groovy/ly/count/android/plugins/uploadSymbols.groovy b/upload-plugin/src/main/groovy/ly/count/android/plugins/uploadSymbols.groovy index 72f073859..f19225249 100644 --- a/upload-plugin/src/main/groovy/ly/count/android/plugins/uploadSymbols.groovy +++ b/upload-plugin/src/main/groovy/ly/count/android/plugins/uploadSymbols.groovy @@ -55,17 +55,27 @@ class UploadSymbolsPlugin implements Plugin { .build() request = new Request.Builder().url(url).post(formBody).build() } - logger.debug("uploadJavaSymbols, Generated request: {}", request.body().toString()) doLast { if (request == null) { logger.error("Request not constructed") throw new StopActionException("Something happened while constructing the request. Please try again.") } + + if (request.body() != null) { + logger.debug("uploadJavaSymbols, Generated request: {}", request.body().toString()) + } else { + logger.error("uploadJavaSymbols, Request body is null which should not be the case") + } + client = new OkHttpClient() Response response = client.newCall(request).execute() if (response.code() != 200) { - logger.error("An error occurred while uploading the mapping file: {}", response.body().string()) + if (response.body() != null) { + logger.error("An error occurred while uploading the mapping file: {}", response.body().string()) + } else { + logger.error("An error occurred while uploading the mapping file, response body null") + } } else { logger.debug("File upload successful") } From 5c0ced0e89416a17d089a844be83cfe4f84fb8e6 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Wed, 14 Aug 2024 11:34:16 +0300 Subject: [PATCH 2/5] fix: upload plugin changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c13b81f..02912a618 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 24.7.2 +* Fixed a bug in the upload plugin where upload was not possible. related to some early loggings + ## 24.7.1 * ! Minor breaking change ! Unsupported types for user properties will now be omitted, they won't be converted to strings. From 2587cd39c1a07b1bd9e995b3f545a0d655f98a67 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Wed, 14 Aug 2024 11:40:32 +0300 Subject: [PATCH 3/5] feat: update version --- gradle.properties | 2 +- sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java | 2 +- sdk/src/main/java/ly/count/android/sdk/Countly.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index db012571f..9e00f0cab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ org.gradle.configureondemand=true android.useAndroidX=true android.enableJetifier=true # RELEASE FIELD SECTION -VERSION_NAME=24.7.1 +VERSION_NAME=24.7.2 GROUP=ly.count.android POM_URL=https://github.com/Countly/countly-sdk-android POM_SCM_URL=https://github.com/Countly/countly-sdk-android diff --git a/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java b/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java index d317e9d8b..af6cce718 100644 --- a/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java +++ b/sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java @@ -42,7 +42,7 @@ public class TestUtils { public final static String commonAppKey = "appkey"; public final static String commonDeviceId = "1234"; public final static String SDK_NAME = "java-native-android"; - public final static String SDK_VERSION = "24.7.1"; + public final static String SDK_VERSION = "24.7.2"; public static final int MAX_THREAD_COUNT_PER_STACK_TRACE = 50; public static class Activity2 extends Activity { diff --git a/sdk/src/main/java/ly/count/android/sdk/Countly.java b/sdk/src/main/java/ly/count/android/sdk/Countly.java index 3aa917d00..4dc0f8714 100644 --- a/sdk/src/main/java/ly/count/android/sdk/Countly.java +++ b/sdk/src/main/java/ly/count/android/sdk/Countly.java @@ -47,7 +47,7 @@ of this software and associated documentation files (the "Software"), to deal */ public class Countly { - private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "24.7.1"; + private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "24.7.2"; /** * Used as request meta data on every request From 9ada3aaef592ddf5341fe1874a8182e910e6d39f Mon Sep 17 00:00:00 2001 From: turtledreams <62231246+turtledreams@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:43:24 +0900 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02912a618..71831fe20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## 24.7.2 -* Fixed a bug in the upload plugin where upload was not possible. related to some early loggings +* Mitigated an issue in the upload plugin that prevented the upload of a symbol file ## 24.7.1 * ! Minor breaking change ! Unsupported types for user properties will now be omitted, they won't be converted to strings. From c71a1a908530a89fe0ede6a4749ae1a462f96826 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Wed, 14 Aug 2024 14:31:56 +0300 Subject: [PATCH 5/5] refactor: add end url end check --- .../groovy/ly/count/android/plugins/uploadSymbols.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upload-plugin/src/main/groovy/ly/count/android/plugins/uploadSymbols.groovy b/upload-plugin/src/main/groovy/ly/count/android/plugins/uploadSymbols.groovy index f19225249..3e0cdb1b6 100644 --- a/upload-plugin/src/main/groovy/ly/count/android/plugins/uploadSymbols.groovy +++ b/upload-plugin/src/main/groovy/ly/count/android/plugins/uploadSymbols.groovy @@ -36,7 +36,10 @@ class UploadSymbolsPlugin implements Plugin { throw new StopExecutionException("Please specify your server in countly block.") } String buildVersion = project.android.defaultConfig.versionName - String url = "${ext.server}/i/crash_symbols/upload_symbol" + String url = ext.server; + String path = "i/crash_symbols/upload_symbol"; + // Ensure there is exactly one "/" between the base URL and the path + url = url.endsWith("/") ? url + path : url + "/" + path; def filePath = "$project.buildDir/$ext.mappingFile" logger.debug("uploadJavaSymbols, Version name:[ {} ], Upload symbol url:[ {} ], Mapping file path:[ {} ]", buildVersion, url, filePath) File file = new File(filePath)