I'm developing a chat module for my employer, and one of the requirements is that I "get enough backlog to fill the screen" when opening the room, instead of always limiting it to a specific number for each query (such as I'm doing right now)
I don't know if I should be dynamically changing the number to query on the client, or should I pass the client's window dimensions to the server, and have the server do some complicated math based on the that size, and what messages are currently available to query.
Is there any standard way of handling this? I looked at Facebook Messenger as a model, and in many cases, it seems to be returning 19-20 at a time, but I've seen some windows where there's 50+. It seems to depend on whether or not there's an image to display, which would fill up a good chunk of the screen.