-
Notifications
You must be signed in to change notification settings - Fork 111
[CHAT SDK] [Help Needed] Best Practices for Paginating Messages in Chat SDK #1951
Copy link
Copy link
Open
Labels
customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.Workflow: This is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Metadata
Metadata
Assignees
Labels
customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.Workflow: This is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
I'm developing an Android app using the Azure Communication Services Chat SDK and facing difficulties with implementing proper pagination for chat messages in a thread.
When attempting to retrieve chat messages in chunks (e.g., 50 or 100 messages at a time) instead of loading all messages at once, I'm experiencing unexpected behaviour. My goal is to:
Current Implementation
I'm using
ListChatMessagesOptions.setMaxPageSize()to set the page size, but when I calllistMessages()with these options, it appears to fetch all pages at once rather than allowing me to fetch them one at a time as needed.Questions
Is this the correct approach for implementing pagination? My understanding was that
setMaxPageSize()should limit each page to N messages, but it seems the SDK is still fetching all pages at once.What is the recommended pattern for implementing "load more" functionality? I'd like to:
Can you provide a code example for proper pagination implementation? Specifically, how to:
Environment
Additional Context
This functionality is critical for our application as chat threads can potentially contain thousands of messages, and loading them all at once causes performance issues and a poor user experience.
Any guidance or examples would be greatly appreciated!