Skip to content

Commit ca87685

Browse files
author
ariefnurputranto
committed
fix issue progress upload not working when enableLog is false
1 parent c7178a2 commit ca87685

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Second, you need to add SDK dependencies inside your app .gradle. Then, you need
5454
```
5555
dependencies {
5656
...
57-
implementation 'com.qiscus.sdk:chat-core:1.3.33'
57+
implementation 'com.qiscus.sdk:chat-core:1.3.34'
5858
}
5959
```
6060

chat-core/src/main/java/com/qiscus/sdk/chat/core/data/remote/QiscusApi.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,16 +1597,19 @@ public void writeTo(@NonNull BufferedSink sink) throws IOException {
15971597
total += read;
15981598
sink.flush();
15991599

1600-
/**
1601-
* When we use HttpLoggingInterceptor,
1602-
* we have issue with progress update not valid.
1603-
* So we must check, first call is to HttpLoggingInterceptor
1604-
* second call is to request
1605-
*/
1606-
if (numWriteToCall > IGNORE_FIRST_NUMBER_OF_WRITE_TO_CALL) {
1600+
if (QiscusCore.getChatConfig().isEnableLog()) {
1601+
/**
1602+
* When we use HttpLoggingInterceptor,
1603+
* we have issue with progress update not valid.
1604+
* So we must check, first call is to HttpLoggingInterceptor
1605+
* second call is to request
1606+
*/
1607+
if (numWriteToCall > IGNORE_FIRST_NUMBER_OF_WRITE_TO_CALL) {
1608+
progressListener.onProgress(total);
1609+
}
1610+
} else {
16071611
progressListener.onProgress(total);
16081612
}
1609-
16101613
}
16111614
} finally {
16121615
Util.closeQuietly(source);

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ chatVersionPatch=0
4141
# === qiscus chat-core library version ===
4242
chatCoreVersionMajor=1
4343
chatCoreVersionMinor=3
44-
chatCoreVersionPatch=33
44+
chatCoreVersionPatch=34
4545

4646
# === qiscus default base url
4747
BASE_URL_SERVER="https://api.qiscus.com/"
@@ -57,7 +57,7 @@ android.enableR8=true
5757

5858
libraryGroupId=com.qiscus.sdk
5959
libraryArtifactId=chat-core
60-
libraryVersion=1.3.33
60+
libraryVersion=1.3.34
6161

6262
libraryGroupIdChat=com.qiscus.sdk
6363
libraryArtifactIdChat=chat

0 commit comments

Comments
 (0)