Skip to content

Commit e2ced9a

Browse files
Internal change - enabled EE for JS target in KMP tests (#361)
* PubNub SDK v10.5.6 release. --------- Co-authored-by: PubNub Release Bot <[email protected]>
1 parent 08c5e04 commit e2ced9a

File tree

20 files changed

+261
-102
lines changed

20 files changed

+261
-102
lines changed

.pubnub.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: kotlin
2-
version: 10.5.5
2+
version: 10.5.6
33
schema: 1
44
scm: github.com/pubnub/kotlin
55
files:
6-
- build/libs/pubnub-kotlin-10.5.5-all.jar
6+
- build/libs/pubnub-kotlin-10.5.6-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.5.5
27-
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.5.5/pubnub-kotlin-10.5.5.jar
26+
package-name: pubnub-kotlin-10.5.6
27+
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.5.6/pubnub-kotlin-10.5.6.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-07-31
125+
version: v10.5.6
126+
changes:
127+
- type: bug
128+
text: "Internal change - enabled EE for JS target in KMP tests."
124129
- date: 2025-07-30
125130
version: v10.5.5
126131
changes:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v10.5.6
2+
July 31 2025
3+
4+
#### Fixed
5+
- Internal change - enabled EE for JS target in KMP tests.
6+
17
## v10.5.5
28
July 30 2025
39

README.md

Lines changed: 1 addition & 1 deletion
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.5.5</version>
23+
<version>10.5.6</version>
2424
</dependency>
2525
```
2626

gradle.properties

Lines changed: 1 addition & 1 deletion
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.5.5
21+
VERSION_NAME=10.5.6
2222
POM_PACKAGING=jar
2323

2424
POM_NAME=PubNub SDK

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ktlint = "12.1.0"
1212
dokka = "2.0.0"
1313
kotlinx_datetime = "0.6.2"
1414
kotlinx_coroutines = "1.10.2"
15-
pubnub_js = "8.6.0"
15+
pubnub_js = "9.8.1"
1616
pubnub_swift = "9.3.0"
1717

1818
[libraries]

kotlin-js-store/yarn.lock

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ esutils@^2.0.2:
280280
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
281281
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
282282

283+
fflate@^0.8.2:
284+
version "0.8.2"
285+
resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea"
286+
integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==
287+
283288
fill-range@^7.0.1:
284289
version "7.0.1"
285290
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
@@ -666,15 +671,16 @@ proxy-from-env@^1.1.0:
666671
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
667672
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
668673

669-
pubnub@8.6.0:
670-
version "8.6.0"
671-
resolved "https://registry.yarnpkg.com/pubnub/-/pubnub-8.6.0.tgz#75524e7ed3653090652d160ce83ac089362a0379"
672-
integrity sha512-LBCglooxiLkNT3ArUOvSJnLKK6/QdeshWY60IWlSQ+SkXlzEjt74wAnX5XriEXKsmza2yw9mFGG6+B5SlczRzA==
674+
pubnub@9.8.1:
675+
version "9.8.1"
676+
resolved "https://registry.yarnpkg.com/pubnub/-/pubnub-9.8.1.tgz#b6b38b23469c18e632403661ef52b83a9058d63d"
677+
integrity sha512-ZeBk6Wn09w1/XpTk388unm1cOZ7da6bZLqoTbh5cMolIwWsEHzvyDnVrk/oE9USxRYr6yeKu/KiLcnj2oG4+fQ==
673678
dependencies:
674679
agentkeepalive "^3.5.2"
675680
buffer "^6.0.3"
676681
cbor-js "^0.1.0"
677682
cbor-sync "^1.0.4"
683+
fflate "^0.8.2"
678684
form-data "^4.0.0"
679685
lil-uuid "^0.1.1"
680686
node-fetch "^2.7.0"

pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/ChannelMetadataTest.kt

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package com.pubnub.test.integration
22

33
import com.pubnub.api.PubNubException
4+
import com.pubnub.api.enums.PNStatusCategory
5+
import com.pubnub.api.models.consumer.PNStatus
46
import com.pubnub.api.models.consumer.objects.PNPage
57
import com.pubnub.api.models.consumer.objects.channel.PNChannelMetadata
68
import com.pubnub.api.models.consumer.pubsub.objects.PNDeleteChannelMetadataEventMessage
79
import com.pubnub.api.models.consumer.pubsub.objects.PNObjectEventResult
810
import com.pubnub.api.models.consumer.pubsub.objects.PNSetChannelMetadataEventMessage
911
import com.pubnub.kmp.PLATFORM
1012
import com.pubnub.kmp.createCustomObject
13+
import com.pubnub.kmp.createStatusListener
1114
import com.pubnub.kmp.readAllBytes
1215
import com.pubnub.kmp.stringToUploadable
1316
import com.pubnub.test.BaseIntegrationTest
@@ -22,6 +25,10 @@ import kotlin.test.assertNotNull
2225
import kotlin.test.assertTrue
2326
import kotlin.time.Duration.Companion.seconds
2427

28+
private const val PN_CONNECTED_CATEGORY = "PNConnectedCategory"
29+
30+
private const val PN_DISCONNECTED_CATEGORY = "PNDisconnectedCategory"
31+
2532
class ChannelMetadataTest : BaseIntegrationTest() {
2633
private val channel = "myChannel" + randomString()
2734
private val name = randomString()
@@ -32,6 +39,108 @@ class ChannelMetadataTest : BaseIntegrationTest() {
3239
private val includeCustom = true
3340
private val type = randomString()
3441

42+
@Test
43+
fun test_disconnect() = runTest(timeout = 30.seconds) {
44+
val channelName = "myChannel"
45+
var disconnectStatus: PNStatus? = null
46+
47+
val statusListener = createStatusListener(pubnub) { _, status ->
48+
if (status.category == PNStatusCategory.PNDisconnectedCategory) {
49+
disconnectStatus = status
50+
}
51+
}
52+
53+
pubnub.test(backgroundScope) {
54+
try {
55+
pubnub.addListener(statusListener)
56+
57+
val channel = pubnub.channel(channelName)
58+
channel.subscription().subscribe()
59+
60+
// Wait for connection status
61+
val connectStatus = nextStatus()
62+
assertEquals(false, connectStatus.error)
63+
assertEquals(PN_CONNECTED_CATEGORY, connectStatus.category.toString())
64+
65+
// Disconnect and wait for disconnect status
66+
pubnub.disconnect()
67+
68+
// Wait for disconnect status using nextStatus() (from test infrastructure)
69+
val disconnectStatusFromQueue = nextStatus()
70+
assertEquals(false, disconnectStatusFromQueue.error)
71+
assertEquals(PN_DISCONNECTED_CATEGORY, disconnectStatusFromQueue.category.toString())
72+
73+
// Verify our listener also captured the disconnect status
74+
assertNotNull(disconnectStatus)
75+
assertEquals(PN_DISCONNECTED_CATEGORY, disconnectStatus!!.category.toString())
76+
} finally {
77+
// Cleanup
78+
pubnub.removeListener(statusListener)
79+
}
80+
}
81+
}
82+
83+
@Test
84+
fun test_reconnect() = runTest(timeout = 30.seconds) {
85+
val channelName = "myChannel"
86+
var disconnectStatus: PNStatus? = null
87+
var reconnectStatus: PNStatus? = null
88+
89+
val statusListener = createStatusListener(pubnub) { _, status ->
90+
when (status.category) {
91+
PNStatusCategory.PNDisconnectedCategory -> {
92+
disconnectStatus = status
93+
}
94+
PNStatusCategory.PNConnectedCategory -> {
95+
// Only capture reconnect status (not initial connect)
96+
if (disconnectStatus != null) {
97+
reconnectStatus = status
98+
}
99+
}
100+
else -> {
101+
// Ignore other status categories
102+
}
103+
}
104+
}
105+
106+
pubnub.test(backgroundScope) {
107+
try {
108+
pubnub.addListener(statusListener)
109+
110+
val channel = pubnub.channel(channelName)
111+
channel.subscription().subscribe()
112+
113+
// Wait for connection status
114+
val connectStatus = nextStatus()
115+
assertEquals(false, connectStatus.error)
116+
assertEquals(PN_CONNECTED_CATEGORY, connectStatus.category.toString())
117+
118+
// Disconnect and wait for disconnect status
119+
pubnub.disconnect()
120+
121+
val disconnectStatusFromQueue = nextStatus()
122+
assertEquals(false, disconnectStatusFromQueue.error)
123+
assertEquals(PN_DISCONNECTED_CATEGORY, disconnectStatusFromQueue.category.toString())
124+
125+
// Reconnect and wait for reconnect status
126+
pubnub.reconnect()
127+
128+
val reconnectStatusFromQueue = nextStatus()
129+
assertEquals(false, reconnectStatusFromQueue.error)
130+
assertEquals(PN_CONNECTED_CATEGORY, reconnectStatusFromQueue.category.toString())
131+
132+
// Verify our listener captured both statuses
133+
assertNotNull(disconnectStatus)
134+
assertEquals(PN_DISCONNECTED_CATEGORY, disconnectStatus!!.category.toString())
135+
assertNotNull(reconnectStatus)
136+
assertEquals(PN_CONNECTED_CATEGORY, reconnectStatus!!.category.toString())
137+
} finally {
138+
// Cleanup
139+
pubnub.removeListener(statusListener)
140+
}
141+
}
142+
}
143+
35144
@Test
36145
fun can_set_metadata() = runTest {
37146
// when

pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/PublishTest.kt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,32 @@ class PublishTest : BaseIntegrationTest() {
3333
@Test
3434
fun can_publish_message_string() =
3535
runTest {
36-
val result = pubnub.publish(channel = channel, message = "some message", customMessageType = "myCustomType").await()
36+
val result =
37+
pubnub.publish(channel = channel, message = "some message", customMessageType = "myCustomType").await()
3738
assertTrue { result.timetoken > 0 }
3839
}
3940

4041
@Test
4142
fun can_signal() =
4243
runTest {
43-
val result = pubnub.signal(channel = channel, message = "some message", customMessageType = "myCustomType").await()
44+
val result =
45+
pubnub.signal(channel = channel, message = "some message", customMessageType = "myCustomType").await()
4446
assertTrue { result.timetoken > 0 }
4547
}
4648

4749
@Test
4850
fun can_publish_message_map() =
4951
runTest {
50-
val result = pubnub.publish(channel, mapOf("platform" to PLATFORM, "otherKey" to 123, "another" to true)).await()
52+
val result =
53+
pubnub.publish(channel, mapOf("platform" to PLATFORM, "otherKey" to 123, "another" to true)).await()
5154
assertTrue { result.timetoken > 0 }
5255
}
5356

5457
@Test
5558
fun can_signal_map() =
5659
runTest {
57-
val result = pubnub.signal(channel, mapOf("platform" to PLATFORM, "otherKey" to 123, "another" to true)).await()
60+
val result =
61+
pubnub.signal(channel, mapOf("platform" to PLATFORM, "otherKey" to 123, "another" to true)).await()
5862
assertTrue { result.timetoken > 0 }
5963
}
6064

@@ -70,6 +74,7 @@ class PublishTest : BaseIntegrationTest() {
7074
fun can_receive_message_with_map_metadata() = runTest {
7175
pubnub.test(backgroundScope) {
7276
pubnub.awaitSubscribe(listOf(channel))
77+
7378
val mapData = mapOf(
7479
"stringValue" to "bbb",
7580
"mapValue" to mapOf("innerKey" to false),
@@ -89,6 +94,8 @@ class PublishTest : BaseIntegrationTest() {
8994

9095
private fun isIOS() = PLATFORM == "iOS"
9196

97+
private fun isJS() = PLATFORM == "JS"
98+
9299
@Test
93100
fun can_receive_message_with_primitive_payload() = runTest {
94101
pubnub.test(backgroundScope) {
@@ -113,6 +120,7 @@ class PublishTest : BaseIntegrationTest() {
113120
fun can_receive_message_with_map_payload() = runTest {
114121
pubnub.test(backgroundScope) {
115122
pubnub.awaitSubscribe(listOf(channel))
123+
116124
val mapData = mapOf(
117125
"stringValue" to "bbb",
118126
"mapValue" to mapOf("innerKey" to false),
@@ -134,6 +142,7 @@ class PublishTest : BaseIntegrationTest() {
134142
fun can_receive_signal_with_map_payload() = runTest {
135143
pubnub.test(backgroundScope) {
136144
pubnub.awaitSubscribe(listOf(channel))
145+
137146
val mapData = mapOf(
138147
"stringValue" to "bbb",
139148
"mapValue" to mapOf("innerKey" to false)
@@ -151,6 +160,7 @@ class PublishTest : BaseIntegrationTest() {
151160
fun can_receive_message_with_payload_with_floats() = runTest {
152161
pubnub.test(backgroundScope) {
153162
pubnub.awaitSubscribe(listOf(channel))
163+
154164
val mapData = mapOf(
155165
"floatValue" to 1.23f,
156166
"doubleValue" to 1.23,

pubnub-kotlin/pubnub-kotlin-core-api/src/jsMain/kotlin/com/pubnub/api/v2/PNConfiguration.js.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ actual fun createPNConfiguration(
5959
override val authToken: String?
6060
get() = null
6161
override val enableEventEngine: Boolean
62-
get() = false
62+
get() = true
6363
override val logVerbosity: PNLogVerbosity
6464
get() = logVerbosity
6565
}
@@ -87,7 +87,7 @@ actual fun createPNConfiguration(
8787
override val authToken: String?
8888
get() = authToken
8989
override val enableEventEngine: Boolean
90-
get() = false
90+
get() = true
9191
override val logVerbosity: PNLogVerbosity
9292
get() = logVerbosity
9393
}

pubnub-kotlin/pubnub-kotlin-docs/src/main/kotlin/com/pubnub/docs/accessManager/ParseTokenOther.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ class ParseTokenOther : SnippetBase() {
99
val pubnub = createPubNub()
1010

1111
// snippet.parseToken
12-
pubnub.parseToken("qEF2AkF0Gmgi5mVDdHRsGQU5Q3Jlc6VEY2hhbqFnc3BhY2UwMQhDZ3JwoENzcGOgQ3VzcqBEdXVpZKFmdXNlcjAxGCBDcGF0pURjaGFuoWdzcGFjZS4qAUNncnCgQ3NwY6BDdXNyoER1dWlkoWZ1c2VyLioYIERtZXRhoER1dWlkbmF1dGhvcml6ZWRVc2VyQ3NpZ1ggkOSK0vQY5LFE5IHctQ6rGokqHbRH8EopbQRGAbU7Zfo=")
12+
pubnub.parseToken(
13+
"qEF2AkF0Gmgi5mVDdHRsGQU5Q3Jlc6VEY2hhbqFnc3BhY2UwMQhDZ3JwoENzcGOgQ3VzcqBEdXVpZKFmdXNlcjAxGCBDcGF0pURjaGFuoWdzcGFjZS4qAUNncnCgQ3NwY6BDdXNyoER1dWlkoWZ1c2VyLioYIERtZXRhoER1dWlkbmF1dGhvcml6ZWRVc2VyQ3NpZ1ggkOSK0vQY5LFE5IHctQ6rGokqHbRH8EopbQRGAbU7Zfo="
14+
)
1315
// snippet.end
1416
}
1517
}

0 commit comments

Comments
 (0)