Skip to content

Commit

Permalink
SetState via Heartbeat fix. (#251)
Browse files Browse the repository at this point in the history
* PubNub SDK v9.2.2 release.

---------

Co-authored-by: PubNub Release Bot <[email protected]>
  • Loading branch information
marcin-cebo and pubnub-release-bot authored Jul 4, 2024
1 parent 55f99d8 commit 4fc3e80
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
13 changes: 9 additions & 4 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: kotlin
version: 9.2.1
version: 9.2.2
schema: 1
scm: github.com/pubnub/kotlin
files:
- build/libs/pubnub-kotlin-9.2.1-all.jar
- build/libs/pubnub-kotlin-9.2.2-all.jar
sdks:
-
type: library
Expand All @@ -23,8 +23,8 @@ sdks:
-
distribution-type: library
distribution-repository: maven
package-name: pubnub-kotlin-9.2.1
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/9.2.1/pubnub-kotlin-9.2.1.jar
package-name: pubnub-kotlin-9.2.2
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/9.2.2/pubnub-kotlin-9.2.2.jar
supported-platforms:
supported-operating-systems:
Android:
Expand Down Expand Up @@ -114,6 +114,11 @@ sdks:
license-url: https://www.apache.org/licenses/LICENSE-2.0.txt
is-required: Required
changelog:
- date: 2024-07-04
version: v9.2.2
changes:
- type: bug
text: "SetState via Heartbeat fix."
- date: 2024-07-02
version: v9.2.1
changes:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v9.2.2
July 04 2024

#### Fixed
- SetState via Heartbeat fix.

## v9.2.1
July 02 2024

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ You will need the publish and subscribe keys to authenticate your app. Get your
<dependency>
<groupId>com.pubnub</groupId>
<artifactId>pubnub-kotlin</artifactId>
<version>9.2.1</version>
<version>9.2.2</version>
</dependency>
```

* for Gradle, add the following dependency in your `gradle.build`:
```groovy
implementation 'com.pubnub:pubnub-kotlin:9.2.1'
implementation 'com.pubnub:pubnub-kotlin:9.2.2'
```

2. Configure your keys and create PubNub instance:
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RELEASE_SIGNING_ENABLED=true
SONATYPE_HOST=DEFAULT
SONATYPE_AUTOMATIC_RELEASE=false
GROUP=com.pubnub
VERSION_NAME=9.2.1
VERSION_NAME=9.2.2
POM_PACKAGING=jar

POM_NAME=PubNub SDK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PubNubCoreTest : BaseTest() {
fun getVersionAndTimeStamp() {
val version = PubNubCore.SDK_VERSION
val timeStamp = PubNubCore.timestamp()
assertEquals("9.2.1", version)
assertEquals("9.2.2", version)
assertTrue(timeStamp > 0)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Setter
Expand Down Expand Up @@ -86,7 +88,15 @@ protected EndpointInterface<Object> createAction() {
} else {
// Some clients require alternative way of setting it through Heartbeat
// Which is a feature brought over from the legacy Java SDK, and we need to be compatible:
return (EndpointInterface<Object>) (Object) new HeartbeatEndpoint(pubnub, channels, channelGroups, state);
return (EndpointInterface<Object>) (Object) new HeartbeatEndpoint(pubnub, channels, channelGroups, composeStateParamValue());
}
}

private Object composeStateParamValue() {
Map<String, Object> stateParamValue = new HashMap<>();
for (String channel : channels) {
stateParamValue.put(channel, state);
}
return stateParamValue;
}
}

0 comments on commit 4fc3e80

Please sign in to comment.