Chats containing a lot of messages are very difficult to handle for the browser especially if there are also a lot of media within the messages.
I've added simple pagination in order to tackle this. Default limit 10000 was chosen empirically as some sort of a tradeoff, it can be overridden via "limit" GET-parameter which is kept through pagination.
Previous behaviour can be restored passing limit=0 as a GET-parameter.
Though there is a room for further optimisation to avoid parsing JSON-lines outside of current page window, it was left behind the scope of current PR.
Hi!
Chats containing a lot of messages are very difficult to handle for the browser especially if there are also a lot of media within the messages. I've added simple pagination in order to tackle this. Default limit 10000 was chosen empirically as some sort of a tradeoff, it can be overridden via "limit" GET-parameter which is kept through pagination. Previous behaviour can be restored passing limit=0 as a GET-parameter.
Though there is a room for further optimisation to avoid parsing JSON-lines outside of current page window, it was left behind the scope of current PR.