When entering a chat from chats list, the chat messages take a few seconds to load and show even when it's a new chat with just a few messages. We are showing a shimmering view while loading them and scrolling to bottom, then hiding it when it's ready
Base branch: develop: project needs to be compiled and run from develop branch where the latest changes are pushed.
Context
- On
screenInit() of ChatViewModel we are calling the right getAllMessages method of messageRepository to get the chat messages/thread messages. We are fetching a small amount first (100), then loading more.
- On
getAllMessagesToShowByChatId of the SphinxRepository we are querying the db, wrapping the messageDbo object into Message objects and linking reactions, replies, purchase msgs, etc to each of them.
- On
getMessageHolderViewStateList of the ChatViewModel we are processing the list of Messages coming from repository and returning a list of MessageHolderViewState that will be finally set on messageHolderViewStateFlow which is collected on MessageListAdapter
MessageHolderViewState class contains lazy vars for each Message row section like statusHeader, imageAttachment, etc
Requirements
- Debug, understand and detect which part of this process takes more time to process causing the delay on chat view load.
- Implement change on logic or UI to improve significantly the loading time of the chat
- If solutions are complex and require any architecture changes that must be handled in a separated ticket, provide details on how this would improve the loading time and general directions on how to implement them
Acceptance Criteria
When entering a chat from chats list, the chat messages take a few seconds to load and show even when it's a new chat with just a few messages. We are showing a shimmering view while loading them and scrolling to bottom, then hiding it when it's ready
Base branch: develop: project needs to be compiled and run from
developbranch where the latest changes are pushed.Context
screenInit()ofChatViewModelwe are calling the rightgetAllMessagesmethod ofmessageRepositoryto get the chat messages/thread messages. We are fetching a small amount first (100), then loading more.getAllMessagesToShowByChatIdof theSphinxRepositorywe are querying the db, wrapping themessageDboobject intoMessageobjects and linking reactions, replies, purchase msgs, etc to each of them.getMessageHolderViewStateListof theChatViewModelwe are processing the list ofMessagescoming from repository and returning a list ofMessageHolderViewStatethat will be finally set onmessageHolderViewStateFlowwhich is collected onMessageListAdapterMessageHolderViewStateclass contains lazy vars for each Message row section likestatusHeader,imageAttachment, etcRequirements
Acceptance Criteria