Open
Description
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()
ofChatViewModel
we are calling the rightgetAllMessages
method ofmessageRepository
to get the chat messages/thread messages. We are fetching a small amount first (100), then loading more. - On
getAllMessagesToShowByChatId
of theSphinxRepository
we are querying the db, wrapping themessageDbo
object intoMessage
objects and linking reactions, replies, purchase msgs, etc to each of them. - On
getMessageHolderViewStateList
of theChatViewModel
we are processing the list ofMessages
coming from repository and returning a list ofMessageHolderViewState
that will be finally set onmessageHolderViewStateFlow
which is collected onMessageListAdapter
MessageHolderViewState
class contains lazy vars for each Message row section likestatusHeader
,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
- Detect the causes or performance issues producing the chat view loading delay
- Implement improvements to reduce it significantly or provide detailed feedback on how to accomplish that