Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty message list #5086

Merged
merged 6 commits into from
Nov 24, 2023
Merged

Fix empty message list #5086

merged 6 commits into from
Nov 24, 2023

Conversation

JcMinarro
Copy link
Member

@JcMinarro JcMinarro commented Nov 23, 2023

🎯 Goal

Messages sent ofline weren't initializing the date when the message was created and if we didn't update the message from the one that is returned from backend, we could arrive to condition where it is not updated never causing a crash when the date of all messages is used to sort a conversation.

Apart of that, if we jump to a message in the past, it could cause a gap on the conversation due the pagination was not implemented properly.

I have created a method to be sure any gap on the conversation list is filled when the State module is used.

Fix: #5034

🧪 Testing

To test it, you will need to jump to a message in the pass within a conversation.
I have create a channel where there are an indexed list of messages to verify the list of messages is loaded properly.
Open the UI-Component sample app, login with "Jc Miñarro" user and click on the conversation with "Daren".
You will need to apply the following patch to ensure you are jumping to the message 50

Patch code to automatically jump to message `50` when go into conversation with "Daren"
Subject: [PATCH] Patch code to automatically jump to message `50` when go into conversation with "Daren"
---
Index: stream-chat-android-ui-components-sample/src/main/kotlin/io/getstream/chat/ui/sample/feature/channel/list/ChannelListFragment.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/stream-chat-android-ui-components-sample/src/main/kotlin/io/getstream/chat/ui/sample/feature/channel/list/ChannelListFragment.kt b/stream-chat-android-ui-components-sample/src/main/kotlin/io/getstream/chat/ui/sample/feature/channel/list/ChannelListFragment.kt
--- a/stream-chat-android-ui-components-sample/src/main/kotlin/io/getstream/chat/ui/sample/feature/channel/list/ChannelListFragment.kt	(revision 83508a78b3d60740438f4f0589b4c3455ec90bf6)
+++ b/stream-chat-android-ui-components-sample/src/main/kotlin/io/getstream/chat/ui/sample/feature/channel/list/ChannelListFragment.kt	(date 1700752105892)
@@ -104,7 +104,7 @@
 
             setChannelItemClickListener {
                 requireActivity().findNavController(R.id.hostFragmentContainer)
-                    .navigateSafely(HomeFragmentDirections.actionOpenChat(it.cid))
+                    .navigateSafely(HomeFragmentDirections.actionOpenChat(it.cid, messageId = "jc-a804c3cb-3e9b-4af1-a56a-54419d372b80"))
             }
 
             setChannelDeleteClickListener { channel ->

🎉 GIF

@JcMinarro JcMinarro force-pushed the fix-empty-message-list branch from d306ba0 to 83508a7 Compare November 23, 2023 15:09
@JcMinarro JcMinarro marked this pull request as ready for review November 23, 2023 15:21
@JcMinarro JcMinarro requested a review from a team as a code owner November 23, 2023 15:21
@JcMinarro JcMinarro force-pushed the fix-empty-message-list branch from 83508a7 to b0a2ec7 Compare November 23, 2023 15:29
@JcMinarro JcMinarro enabled auto-merge (rebase) November 24, 2023 09:04
@JcMinarro JcMinarro force-pushed the fix-empty-message-list branch from b0a2ec7 to 9a8bc5a Compare November 24, 2023 09:05
@JcMinarro JcMinarro merged commit e406ee9 into develop Nov 24, 2023
7 checks passed
@JcMinarro JcMinarro deleted the fix-empty-message-list branch November 24, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with Reply Message Functionality in Push Notifications
2 participants