-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
perf: only fetch limited messages (pagination) #745
Conversation
api: previous and new message fetching API perf: send message reactions in websocket perf: send deleted message in websocket perf: send edited message in websocket perf: send saved message event in websocket perf: send new messages in websocket fix: User avatar is showing skeleton on scroll #625 feat: highlight replied message after scroll perf: render action palette with hover debounce
Even better solution: No fetches, just rely on websockets and SWR for everything (yeah). Instead of maintaining two arrays for messages and previous messages, we can maintain a single array We use the mutate method to update the messages array when messages are received, updated, deleted, etc. Since we are using Web Socket events, this saves multiple round-trips to the server to fetch messages (pre Raven v1.5) When the page changes and the user comes back to the chat, the messages are fetched again and hence the messages array is updated with only new messages This also helps when the user goes directly to a specific message from somewhere(notification, search etc.). |
|
Unread message counts:For every channel member, we store a The
When Raven loads, we fetch the unread message counts for all channels. Post that, updates to these counts are made when:
The realtime event for unread message count changed is published when:
Further optimisations that could be done: do not fetch unread count for a channel - just increment the count by 1 |
api: previous and new message fetching API
perf: send message reactions in websocket
perf: send deleted message in websocket
perf: send edited message in websocket
perf: send saved message event in websocket
perf: send new messages in websocket (closes #462)
fix: User avatar is showing skeleton on scroll (closes #625)
feat: highlight replied message after scroll
perf: render action palette with hover debounce
Changes only made on the web app so far. Mobile app and desk integration needs to be changed.
Pending items:
Will keep adding to this thread as things progress.