diff --git a/.pubnub.yml b/.pubnub.yml index 83b672222..758621c3d 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,9 +1,9 @@ name: kotlin -version: 6.0.0 +version: 6.0.1 schema: 1 scm: github.com/pubnub/kotlin files: - - build/libs/pubnub-kotlin-6.0.0-all.jar + - build/libs/pubnub-kotlin-6.0.1-all.jar sdks: - type: library @@ -233,6 +233,13 @@ sdks: license-url: https://github.com/stleary/JSON-java/blob/20210307/LICENSE is-required: Required changelog: + - + version: v6.0.1 + date: 2021-05-25 + changes: + - + type: bug + text: "There was missing PNAcknowledgmentCategory status callback after unsubscribe operation. Problem was caused by ungaught SSLException. This release provides a fix for the issue." - version: v6.0.0 date: 2021-05-12 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3252945cd..c2912f835 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,8 @@ -## [v6.0.0](https://github.com/pubnub/kotlin/releases/tag/v6.0.0) -May 12 2021 +## [v6.0.1](https://github.com/pubnub/kotlin/releases/tag/v6.0.1) +May 25 2021 -[Full Changelog](https://github.com/pubnub/kotlin/compare/v5.1.3...v6.0.0) +[Full Changelog](https://github.com/pubnub/kotlin/compare/v6.0.0...v6.0.1) -- Random initialisation vector used when encryption enabled is now default behaviour. -- Bumping versions of used dependencies. -- There were some non daemon threads running in background preventing VM from exiting. Now they are daemon threads. +- There was missing PNAcknowledgmentCategory status callback after unsubscribe operation. Problem was caused by ungaught SSLException. This release provides a fix for the issue. diff --git a/README.md b/README.md index bff287055..56239f748 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your <dependency> <groupId>com.pubnub</groupId> <artifactId>pubnub-gson</artifactId> - <version>6.0.0</version> + <version>6.0.1</version> </dependency> ``` diff --git a/build.gradle b/build.gradle index b94d42524..f9e043b89 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ plugins { } group = 'com.pubnub' -version = '6.0.0' +version = '6.0.1' repositories { mavenCentral() diff --git a/src/integrationTest/kotlin/com/pubnub/api/integration/SubscribeIntegrationTests.kt b/src/integrationTest/kotlin/com/pubnub/api/integration/SubscribeIntegrationTests.kt index 26421aca2..86090dd4a 100644 --- a/src/integrationTest/kotlin/com/pubnub/api/integration/SubscribeIntegrationTests.kt +++ b/src/integrationTest/kotlin/com/pubnub/api/integration/SubscribeIntegrationTests.kt @@ -107,10 +107,18 @@ class SubscribeIntegrationTests : BaseIntegrationTest() { @Test fun testUnsubscribeFromAllChannels() { val success = AtomicBoolean() + val randomChannel = randomChannel() + + pubnub.subscribeToBlocking(randomChannel) pubnub.addListener(object : SubscribeCallback() { override fun status(pubnub: PubNub, pnStatus: PNStatus) { - success.set(pubnub.getSubscribedChannels().isEmpty()) + if (pnStatus.category == PNStatusCategory.PNAcknowledgmentCategory && + pnStatus.affectedChannels.contains(randomChannel) && + pnStatus.operation == PNOperationType.PNUnsubscribeOperation + ) { + success.set(pubnub.getSubscribedChannels().isEmpty()) + } } }) diff --git a/src/main/kotlin/com/pubnub/api/PubNub.kt b/src/main/kotlin/com/pubnub/api/PubNub.kt index 4eab5e3a8..bdbeaf017 100644 --- a/src/main/kotlin/com/pubnub/api/PubNub.kt +++ b/src/main/kotlin/com/pubnub/api/PubNub.kt @@ -79,7 +79,7 @@ class PubNub(val configuration: PNConfiguration) { private companion object Constants { private const val TIMESTAMP_DIVIDER = 1000 - private const val SDK_VERSION = "6.0.0" + private const val SDK_VERSION = "6.0.1" private const val MAX_SEQUENCE = 65535 } diff --git a/src/main/kotlin/com/pubnub/okhttp3/PNCall.kt b/src/main/kotlin/com/pubnub/okhttp3/PNCall.kt index a7f29d4ba..be935ee22 100644 --- a/src/main/kotlin/com/pubnub/okhttp3/PNCall.kt +++ b/src/main/kotlin/com/pubnub/okhttp3/PNCall.kt @@ -4,6 +4,7 @@ import okhttp3.Call import okhttp3.Connection import org.slf4j.LoggerFactory import java.net.SocketException +import javax.net.ssl.SSLException import kotlin.reflect.full.declaredMemberFunctions import kotlin.reflect.jvm.isAccessible @@ -17,6 +18,8 @@ internal class PNCall( realCall.getConnection()?.socket()?.shutdownInput() } catch (se: SocketException) { log.warn("Caught exception when canceling call", se) + } catch (_: SSLException) { + // we have to swallow this exception, otherwise cancel will break status delivery } catch (uoe: UnsupportedOperationException) { // silent catch } diff --git a/src/test/kotlin/com/pubnub/api/legacy/PubNubTest.kt b/src/test/kotlin/com/pubnub/api/legacy/PubNubTest.kt index 4232734e2..58da53438 100644 --- a/src/test/kotlin/com/pubnub/api/legacy/PubNubTest.kt +++ b/src/test/kotlin/com/pubnub/api/legacy/PubNubTest.kt @@ -67,7 +67,7 @@ class PubNubTest : BaseTest() { fun getVersionAndTimeStamp() { val version = pubnub.version val timeStamp = pubnub.timestamp() - assertEquals("6.0.0", version) + assertEquals("6.0.1", version) assertTrue(timeStamp > 0) } }