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

Merge older fastenings from the cache when paging through a conversation #59

Closed
nesium opened this issue Feb 22, 2024 · 0 comments
Closed

Comments

@nesium
Copy link
Contributor

nesium commented Feb 22, 2024

When the user scrolls through a conversation we're loading every message from MAM up to the requested point.

The order is always from newest to oldest. Each loaded page of messages is then saved to the cache. Due to the nature of XMPP all messages are loaded in a stream where newer messages can reference older messages, e.g. a reaction to an older message results in a new message carrying the reaction.

When scrolling further up to see older messages the core lib should fetch the newer - already loaded - messages from the cache that reference the loaded older messages to reduce them into their final state: A single message object that contains all read markers, reactions and so on.

This approach works perfectly fine for this use case but would not work for displaying an older message when the newer messages have not been loaded before. To handle this second case efficiently we'd need server support as mentioned in prose-im/prose-pod-system#10, but that is out of scope for this issue.

Also refs prose-im/prose-app-web#56

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

No branches or pull requests

1 participant