Skip to content

Commit d7a8a07

Browse files
authored
feat(chat): adopt flipcash2 0.17.0 (group descriptions) (#1684)
1 parent c49428d commit d7a8a07

22 files changed

Lines changed: 1165 additions & 2 deletions

File tree

‎apps/flipcash/shared/chat/src/main/kotlin/com/flipcash/shared/chat/internal/delegates/EventStreamDelegate.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,10 @@ class EventStreamDelegate @Inject constructor(
425425
// GetChat rather than waiting on a later update to correct it.
426426
metadataDataSource.updateTitle(chatId, metaUpdate.newTitle)
427427
}
428+
is MetadataUpdate.DescriptionChanged -> {
429+
// Same best-effort contract as TitleChanged above. Empty means cleared.
430+
metadataDataSource.updateDescription(chatId, metaUpdate.newDescription)
431+
}
428432
is MetadataUpdate.PictureChanged -> {
429433
// Same best-effort contract as TitleChanged above.
430434
metadataDataSource.updatePicture(chatId, metaUpdate.newPicture)

‎apps/flipcash/shared/chat/src/test/kotlin/com/flipcash/shared/chat/ChatMetadataEditStreamTest.kt‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,24 @@ class ChatMetadataEditStreamTest {
159159
}
160160
}
161161

162+
@Test
163+
fun `a description change from the stream is stored`() = runTest(testDispatchers.dispatcher) {
164+
tornDown {
165+
triggerCollection()
166+
167+
chatUpdatesChannel.send(
168+
ChatUpdate(
169+
chatId = chatId,
170+
metadataUpdates = listOf(MetadataUpdate.DescriptionChanged("New description")),
171+
),
172+
)
173+
advanceTimeBy(1_000.milliseconds)
174+
runCurrent()
175+
176+
coVerify(exactly = 1) { metadataDataSource.updateDescription(chatId, "New description") }
177+
}
178+
}
179+
162180
@Test
163181
fun `a picture change from the stream is stored`() = runTest(testDispatchers.dispatcher) {
164182
tornDown {

0 commit comments

Comments
 (0)