Hello everyone, this is a very basic question which I haven’t been able to find any discussion on.
For me, the expected behavior of a chat application is to load some ammount of messages from the database initially, and then show all new messages that appear. Maybe I initially load only the latest 10 messages (by sorting on the date and setting initial limit of 10 in the publication function),
and then implement infinite scrolling to fetch older messages.
This would result in this behavior: Some user logs in, sees the 10 newest messages from the db (call them A). Newer messages (B) start to arrive.Now the messages A would start to dissapear (because we set limit to 10).
How would you solve this issue? I see one basic solution, which is to have two different pubs/subs, one set up for receiving new messages and one for paginating the chat history. Another solution is to increment the limit when a new message appears on the client.
Am I missing something ? Does anyone else recognize this as a common thing to address with meteor?