Skip to content

Commit

Permalink
Merge branch 'main' into rehan/push-click-behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 committed Nov 14, 2023
2 parents a695cf7 + bad40ae commit 2032b89
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-sample-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ jobs:
# CLI to replace strings in files. The CLI recommends using `cargo install` which is slow. This Action is fast because it downloads pre-built binaries.
# If using sd on macos, "brew install" works great. for Linux, this is the recommended way.
- name: Install sd CLI to use later in the workflow
uses: kenji-miyake/setup-sd@v1
# uses: kenji-miyake/setup-sd@v1
uses: levibostian/setup-sd@add-file-extension # Using fork until upstream Action has bug fixed in it.

- name: Install tools from Gemfile (ruby language) used for building our apps with
uses: ruby/setup-ruby@v1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
- uses: actions/checkout@v4
# If using sd on macos, "brew install" works great. for Linux, this is the recommended way.
- name: Install sd CLI to use later in the workflow
uses: kenji-miyake/setup-sd@v1
# uses: kenji-miyake/setup-sd@v1
uses: levibostian/setup-sd@add-file-extension # Using fork until upstream Action has bug fixed in it.

# Semantic-release tool is used to:
# 1. Determine the next semantic version for the software during deployment.
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.7.1](https://github.com/customerio/customerio-android/compare/3.7.0...3.7.1) (2023-11-09)


### Bug Fixes

* add priority field to message and sorting by priority within local store ([#276](https://github.com/customerio/customerio-android/issues/276)) ([ddb0359](https://github.com/customerio/customerio-android/commit/ddb035983a9db5b5b7a711843a3dc15a8dc45a02))

## [3.7.0](https://github.com/customerio/customerio-android/compare/3.6.7...3.7.0) (2023-10-25)


Expand Down
14 changes: 8 additions & 6 deletions messaginginapp/api/messaginginapp.api
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,19 @@ public final class io/customer/messaginginapp/gist/data/model/LogEvent {

public final class io/customer/messaginginapp/gist/data/model/Message {
public fun <init> ()V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Map;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/util/Map;
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lio/customer/messaginginapp/gist/data/model/Message;
public static synthetic fun copy$default (Lio/customer/messaginginapp/gist/data/model/Message;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)Lio/customer/messaginginapp/gist/data/model/Message;
public final fun component3 ()Ljava/lang/Integer;
public final fun component4 ()Ljava/lang/String;
public final fun component5 ()Ljava/util/Map;
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Map;)Lio/customer/messaginginapp/gist/data/model/Message;
public static synthetic fun copy$default (Lio/customer/messaginginapp/gist/data/model/Message;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)Lio/customer/messaginginapp/gist/data/model/Message;
public fun equals (Ljava/lang/Object;)Z
public final fun getInstanceId ()Ljava/lang/String;
public final fun getMessageId ()Ljava/lang/String;
public final fun getPriority ()Ljava/lang/Integer;
public final fun getProperties ()Ljava/util/Map;
public final fun getQueueId ()Ljava/lang/String;
public fun hashCode ()I
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import okhttp3.Cache
import okhttp3.OkHttpClient
import okhttp3.Response
import okhttp3.ResponseBody.Companion.toResponseBody
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

class Queue : GistListener {

private var localMessageStore: MutableList<Message> = mutableListOf()
private val cacheMap = mutableMapOf<String, Response>()

init {
GistSdk.addListener(this)
Expand Down Expand Up @@ -143,7 +141,9 @@ class Queue : GistListener {
}

private fun handleMessages(messages: List<Message>) {
for (message in messages) {
// Sorting messages by priority and placing nulls last
val sortedMessages = messages.sortedWith(compareBy(nullsLast()) { it.priority })

Check warning on line 145 in messaginginapp/src/main/java/io/customer/messaginginapp/gist/data/listeners/Queue.kt

View check run for this annotation

Codecov / codecov/patch

messaginginapp/src/main/java/io/customer/messaginginapp/gist/data/listeners/Queue.kt#L145

Added line #L145 was not covered by tests
for (message in sortedMessages) {
processMessage(message)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ data class GistProperties(
data class Message(
val messageId: String = "",
val instanceId: String = UUID.randomUUID().toString(),
val priority: Int? = null,
val queueId: String? = null,
val properties: Map<String, Any?>? = null
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/io/customer/sdk/Version.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ package io.customer.sdk

internal object Version {

const val version: String = "3.7.0"
const val version: String = "3.7.1"
}

0 comments on commit 2032b89

Please sign in to comment.