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

Added pagination for GetRoomMessagesReactor #214

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

jayesh00949
Copy link
Contributor

All the messages of the room is getting sent together from the reactor to the frontend which is causing delay in loading the messages to the screen. So, we have added pagination for the response.
Modifications -
Added two parameters limit and offset in GetRoomMessagesReactor which are optional parameter and will be set to -1 if not sent from frontend.
Overloaded the method "doRetreiveConversation" adding the parameter limit and offset and extracted the common code in addColumns method. In the overloaded method we are setting limit and offset to the query and also sorting it in desc order to get the latest message first.

@kunal0137
Copy link
Collaborator

cleaned up some minor things but are we sure this is how we want this to work? im not sure how it would work in actual since you are switching to DESC sorted and then reversing the collection. seems odd but lets walk through an example of how an app would actually use it

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.

2 participants