File tree Expand file tree Collapse file tree 7 files changed +35
-14
lines changed
pubnub-core/pubnub-core-impl/src
main/kotlin/com/pubnub/internal
presence/eventengine/effect
test/kotlin/com/pubnub/api/legacy Expand file tree Collapse file tree 7 files changed +35
-14
lines changed Original file line number Diff line number Diff line change 1
1
name : kotlin
2
- version : 9.2.3
2
+ version : 9.2.4
3
3
schema : 1
4
4
scm : github.com/pubnub/kotlin
5
5
files :
6
- - build/libs/pubnub-kotlin-9.2.3 -all.jar
6
+ - build/libs/pubnub-kotlin-9.2.4 -all.jar
7
7
sdks :
8
8
-
9
9
type : library
23
23
-
24
24
distribution-type : library
25
25
distribution-repository : maven
26
- package-name : pubnub-kotlin-9.2.3
27
- location : https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/9.2.3 /pubnub-kotlin-9.2.3 .jar
26
+ package-name : pubnub-kotlin-9.2.4
27
+ location : https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/9.2.4 /pubnub-kotlin-9.2.4 .jar
28
28
supported-platforms :
29
29
supported-operating-systems :
30
30
Android :
@@ -114,6 +114,11 @@ sdks:
114
114
license-url : https://www.apache.org/licenses/LICENSE-2.0.txt
115
115
is-required : Required
116
116
changelog :
117
+ - date : 2024-08-19
118
+ version : v9.2.4
119
+ changes :
120
+ - type : bug
121
+ text : " Fixes a crash on Android after `PubNub.destroy` is called and there are requests running."
117
122
- date : 2024-07-29
118
123
version : v9.2.3
119
124
changes :
Original file line number Diff line number Diff line change
1
+ ## v9.2.4
2
+ August 19 2024
3
+
4
+ #### Fixed
5
+ - Fixes a crash on Android after ` PubNub.destroy ` is called and there are requests running.
6
+
1
7
## v9.2.3
2
8
July 29 2024
3
9
Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ You will need the publish and subscribe keys to authenticate your app. Get your
20
20
<dependency >
21
21
<groupId >com.pubnub</groupId >
22
22
<artifactId >pubnub-kotlin</artifactId >
23
- <version >9.2.3 </version >
23
+ <version >9.2.4 </version >
24
24
</dependency >
25
25
```
26
26
27
27
* for Gradle, add the following dependency in your `gradle.build`:
28
28
```groovy
29
- implementation 'com.pubnub:pubnub-kotlin:9.2.3 '
29
+ implementation 'com.pubnub:pubnub-kotlin:9.2.4 '
30
30
```
31
31
32
32
2. Configure your keys and create PubNub instance:
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ RELEASE_SIGNING_ENABLED=true
19
19
SONATYPE_HOST =DEFAULT
20
20
SONATYPE_AUTOMATIC_RELEASE =false
21
21
GROUP =com.pubnub
22
- VERSION_NAME =9.2.3
22
+ VERSION_NAME =9.2.4
23
23
POM_PACKAGING =jar
24
24
25
25
POM_NAME =PubNub SDK
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import com.pubnub.internal.eventengine.Sink
5
5
import com.pubnub.internal.extension.scheduleWithDelay
6
6
import com.pubnub.internal.presence.eventengine.event.PresenceEvent
7
7
import org.slf4j.LoggerFactory
8
+ import java.util.concurrent.RejectedExecutionException
8
9
import java.util.concurrent.ScheduledExecutorService
9
10
import java.util.concurrent.ScheduledFuture
10
11
import kotlin.time.Duration
@@ -29,10 +30,14 @@ internal class WaitEffect(
29
30
return
30
31
}
31
32
32
- scheduled =
33
- executorService.scheduleWithDelay(heartbeatInterval) {
34
- presenceEventSink.add(PresenceEvent .TimesUp )
35
- }
33
+ try {
34
+ scheduled =
35
+ executorService.scheduleWithDelay(heartbeatInterval) {
36
+ presenceEventSink.add(PresenceEvent .TimesUp )
37
+ }
38
+ } catch (_: RejectedExecutionException ) {
39
+ log.trace(" Unable to schedule retry, PubNub was likely already destroyed." )
40
+ }
36
41
}
37
42
38
43
@Synchronized
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory
7
7
import retrofit2.Call
8
8
import retrofit2.Callback
9
9
import retrofit2.Response
10
+ import java.util.concurrent.RejectedExecutionException
10
11
import java.util.concurrent.ScheduledExecutorService
11
12
import kotlin.time.Duration
12
13
import kotlin.time.Duration.Companion.milliseconds
@@ -82,8 +83,12 @@ internal abstract class RetryableCallback<T>(
82
83
val effectiveDelay: Duration = delay + randomDelayInMillis.milliseconds
83
84
log.trace(" Added random delay so effective retry delay is ${effectiveDelay.inWholeMilliseconds} millis" )
84
85
// don't want to block the main thread in case of Android so using executorService
85
- executorService.scheduleWithDelay(effectiveDelay) {
86
- call.clone().enqueue(this )
86
+ try {
87
+ executorService.scheduleWithDelay(effectiveDelay) {
88
+ call.clone().enqueue(this )
89
+ }
90
+ } catch (_: RejectedExecutionException ) {
91
+ log.trace(" Unable to schedule retry, PubNub was likely already destroyed." )
87
92
}
88
93
}
89
94
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ class PubNubCoreTest : BaseTest() {
66
66
fun getVersionAndTimeStamp () {
67
67
val version = PubNubCore .SDK_VERSION
68
68
val timeStamp = PubNubCore .timestamp()
69
- assertEquals(" 9.2.3 " , version)
69
+ assertEquals(" 9.2.4 " , version)
70
70
assertTrue(timeStamp > 0 )
71
71
}
72
72
You can’t perform that action at this time.
0 commit comments