spreed
spreed copied to clipboard
Cache conversations to speed up conversation display
Presently, the current version of the Nextcloud desktop client lacks conversation caching, resulting in a delay when users click on a conversation.
Enhancing the user experience would involve enabling users to click on a conversation without having to wait for it to load. Instead, the conversation should be promptly displayed upon the user's click.
A possible solution could be to cache conversations in IndexedDB and broadcast updates to other tabs, similar to the conversation list.
The complex part here would be as usual — cache invalidation:
- Deleting messages
- New feature — editing messages
When the client is loaded, it should somehow get updates about the messages from the cache that are to be updated or deleted. For example, always fetch conversation messages on open as currently, using cache only to optimize initial rendering and multi-tabs.
When the client is loaded, it should somehow get updates about the messages from the cache that are to be updated or deleted.
There are hidden system messages being sent having the modified/deleted message as parent, because that is how the iOS app handles it.
There are hidden system messages being sent having the modified/deleted message as parent, because that is how the iOS app handles it.
So, fetching new messages will inform about deleting/modifying old messages, poll changes (and reactions?). Then there is not this complex part, doable.
[...] (and reactions?).
Yep. These are the messages we currently consider an "update message": https://github.com/nextcloud/talk-ios/blob/c53dd7b6cb05d793a542d2ca3ed69c5ac98e2933/NextcloudTalk/NCChatMessage.m#L254-L262
When we receive such a message, we update the corresponding message and the quotes of that message, see https://github.com/nextcloud/talk-ios/blob/c53dd7b6cb05d793a542d2ca3ed69c5ac98e2933/NextcloudTalk/BaseChatViewController.swift#L579-L614