Skip to content

Commit 388ed6b

Browse files
committed
Fix.
1 parent ff2f58f commit 388ed6b

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

  • stream-chat-android-state/src

stream-chat-android-state/src/main/java/io/getstream/chat/android/state/sync/internal/SyncManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ internal class SyncManager(
476476
val groupsParam = activeGroupedLogics
477477
.mapNotNull { logic ->
478478
val key = logic.groupKey() ?: return@mapNotNull null
479-
val cfg = logic.groupedQueryConfig() ?: return@mapNotNull null
480-
key to GroupedChannelsGroupQuery(limit = cfg.pageSize)
479+
val cfg = logic.groupedQueryConfig()
480+
key to GroupedChannelsGroupQuery(limit = cfg?.pageSize)
481481
}
482482
.toMap()
483483
.takeIf { it.isNotEmpty() }

stream-chat-android-state/src/test/java/io/getstream/chat/android/state/internal/SyncManagerTest.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import io.getstream.chat.android.core.internal.coroutines.Tube
3737
import io.getstream.chat.android.models.ConnectionState
3838
import io.getstream.chat.android.models.GroupedChannels
3939
import io.getstream.chat.android.models.GroupedChannelsGroup
40+
import io.getstream.chat.android.models.GroupedChannelsGroupQuery
4041
import io.getstream.chat.android.models.InFilterObject
4142
import io.getstream.chat.android.models.Location
4243
import io.getstream.chat.android.models.SyncStatus
@@ -606,7 +607,7 @@ internal class SyncManagerTest {
606607

607608
verify(chatClient).queryGroupedChannelsInternal(
608609
limit = null,
609-
groups = mapOf("all" to io.getstream.chat.android.models.GroupedChannelsGroupQuery(limit = 5)),
610+
groups = mapOf("all" to GroupedChannelsGroupQuery(limit = 5)),
610611
watch = true,
611612
presence = false,
612613
)
@@ -1004,8 +1005,8 @@ internal class SyncManagerTest {
10041005
verify(chatClient).queryGroupedChannelsInternal(
10051006
limit = null,
10061007
groups = mapOf(
1007-
"a" to io.getstream.chat.android.models.GroupedChannelsGroupQuery(limit = 5),
1008-
"b" to io.getstream.chat.android.models.GroupedChannelsGroupQuery(limit = 5),
1008+
"a" to GroupedChannelsGroupQuery(limit = 5),
1009+
"b" to GroupedChannelsGroupQuery(limit = 5),
10091010
),
10101011
watch = true,
10111012
presence = false,
@@ -1055,14 +1056,14 @@ internal class SyncManagerTest {
10551056
// as `{}` and signals "include this group in the response".
10561057
verify(chatClient).queryGroupedChannelsInternal(
10571058
limit = 20,
1058-
groups = mapOf("all" to io.getstream.chat.android.models.GroupedChannelsGroupQuery(limit = null)),
1059+
groups = mapOf("all" to GroupedChannelsGroupQuery(limit = null)),
10591060
watch = true,
10601061
presence = false,
10611062
)
10621063
}
10631064

10641065
@Test
1065-
fun `on reconnect with no captured config should fall back to method defaults`() =
1066+
fun `on reconnect with no captured config should still include the group key with empty entry`() =
10661067
runTest(testDispatcher) {
10671068
val createdAt = localDate()
10681069
val rawCreatedAt = streamDateFormatter.format(createdAt)
@@ -1095,7 +1096,7 @@ internal class SyncManagerTest {
10951096

10961097
verify(chatClient).queryGroupedChannelsInternal(
10971098
limit = null,
1098-
groups = null,
1099+
groups = mapOf("all" to GroupedChannelsGroupQuery(limit = null)),
10991100
watch = true,
11001101
presence = false,
11011102
)

0 commit comments

Comments
 (0)