Skip to content

Detect delay causes and improve chat loading time #124

Open
@tomastiminskas

Description

@tomastiminskas

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

  • 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions