Skip to content

Commit d40a520

Browse files
pubNub.forceDestroy should force okHttpClient executor service to shoutDown immediately. (#331)
* PubNub SDK v10.4.1 release. --------- Co-authored-by: PubNub Release Bot <[email protected]>
1 parent 4f5c588 commit d40a520

File tree

7 files changed

+29
-26
lines changed

7 files changed

+29
-26
lines changed

.pubnub.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: kotlin
2-
version: 10.4.0
2+
version: 10.4.1
33
schema: 1
44
scm: github.com/pubnub/kotlin
55
files:
6-
- build/libs/pubnub-kotlin-10.4.0-all.jar
6+
- build/libs/pubnub-kotlin-10.4.1-all.jar
77
sdks:
88
-
99
type: library
@@ -23,8 +23,8 @@ sdks:
2323
-
2424
distribution-type: library
2525
distribution-repository: maven
26-
package-name: pubnub-kotlin-10.4.0
27-
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.4.0/pubnub-kotlin-10.4.0.jar
26+
package-name: pubnub-kotlin-10.4.1
27+
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.4.1/pubnub-kotlin-10.4.1.jar
2828
supported-platforms:
2929
supported-operating-systems:
3030
Android:
@@ -121,6 +121,11 @@ sdks:
121121
license-url: https://www.apache.org/licenses/LICENSE-2.0.txt
122122
is-required: Required
123123
changelog:
124+
- date: 2025-01-24
125+
version: v10.4.1
126+
changes:
127+
- type: bug
128+
text: "PubNub.forceDestroy should cause okHttpClient executor service to shutDown immediately."
124129
- date: 2025-01-21
125130
version: v10.4.0
126131
changes:

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v10.4.1
2+
January 24 2025
3+
4+
#### Fixed
5+
- PubNub.forceDestroy should cause okHttpClient executor service to shutDown immediately.
6+
17
## v10.4.0
28
January 21 2025
39

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your
2020
<dependency>
2121
<groupId>com.pubnub</groupId>
2222
<artifactId>pubnub-kotlin</artifactId>
23-
<version>10.4.0</version>
23+
<version>10.4.1</version>
2424
</dependency>
2525
```
2626

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RELEASE_SIGNING_ENABLED=true
1818
SONATYPE_HOST=DEFAULT
1919
SONATYPE_AUTOMATIC_RELEASE=false
2020
GROUP=com.pubnub
21-
VERSION_NAME=10.4.0
21+
VERSION_NAME=10.4.1
2222
POM_PACKAGING=jar
2323

2424
POM_NAME=PubNub SDK

kotlin-js-store/yarn.lock

-16
Original file line numberDiff line numberDiff line change
@@ -659,22 +659,6 @@ proxy-from-env@^1.1.0:
659659
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
660660
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
661661

662-
663-
version "8.4.1"
664-
resolved "https://registry.yarnpkg.com/pubnub/-/pubnub-8.4.1.tgz#5f6f19e84d3187dc8aee0a458bd6b05e90d43e6a"
665-
integrity sha512-mPlwVoHJDWPasZx52UfSMiPX5TATm5A+ficSogyqDqTQ4w5EQnwxH+PJdsWc0mPnlT051jM1vIISMeM0fQ30CQ==
666-
dependencies:
667-
agentkeepalive "^3.5.2"
668-
buffer "^6.0.3"
669-
cbor-js "^0.1.0"
670-
cbor-sync "^1.0.4"
671-
form-data "^4.0.0"
672-
lil-uuid "^0.1.1"
673-
node-fetch "^2.7.0"
674-
proxy-agent "^6.3.0"
675-
react-native-url-polyfill "^2.0.0"
676-
text-encoding "^0.7.0"
677-
678662
679663
version "8.6.0"
680664
resolved "https://registry.yarnpkg.com/pubnub/-/pubnub-8.6.0.tgz#75524e7ed3653090652d160ce83ac089362a0379"

pubnub-kotlin/pubnub-kotlin-impl/src/main/kotlin/com/pubnub/internal/managers/RetrofitManager.kt

+11-3
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,19 @@ class RetrofitManager(
172172
) {
173173
if (client != null) {
174174
client.dispatcher.cancelAll()
175+
176+
val executorService = client.dispatcher.executorService
177+
executorService.shutdown()
175178
if (force) {
176-
client.connectionPool.evictAll()
177-
val executorService = client.dispatcher.executorService
178-
executorService.shutdown()
179+
try {
180+
if (!executorService.awaitTermination(100, TimeUnit.MILLISECONDS)) {
181+
executorService.shutdownNow()
182+
}
183+
} catch (e: InterruptedException) {
184+
executorService.shutdownNow()
185+
}
179186
}
187+
client.connectionPool.evictAll()
180188
}
181189
}
182190
}

pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class PubNubImplTest : BaseTest() {
5656
fun getVersionAndTimeStamp() {
5757
val version = PubNubImpl.SDK_VERSION
5858
val timeStamp = PubNubImpl.timestamp()
59-
assertEquals("10.4.0", version)
59+
assertEquals("10.4.1", version)
6060
assertTrue(timeStamp > 0)
6161
}
6262

0 commit comments

Comments
 (0)