I have implemented a messaging system in which I perform a backend query with “single time query” disabled (see image). This allows all users participating in the chat to have messages updated in real time. It works, but the backend query does not allow me to take advantage of the power of pagination, so I retrieve the entire message history at once, even though users will probably not scroll through it all 😟
So I opted for a query via API Call because this is the only method that allows me to use pagination (used on a list view of course). Once again, it works, the oldest messages are loaded in chunks, everything is fine, youpie tralala ! But API Call requests don't benefit from the disabled “single time query”, you have to refresh manually using a subscription on the relevant table and activate real time on it. The problem is not the subscription but the refresh itself... it will re-render the list view and therefore display a loading spinner between each message. So typically, if I'm in a group and I'm writing a message, I'll have loading spinners everywhere if they send their messages before me, and it's important to note that even if the “Backend Query Loading Widget” is set to “unset,” the loading spinner is displayed by default 😢
What I need is a messaging page with pagination where the data is retrieved as if I had a “single time query” disabled, so without loading or freezing.
I don't want to do any hacking by that I mean using non-standard or improper techniques, like redirecting the user to another page and then bringing them back just to force a refresh.
Api Call + Pagination but manual "refresh database request" on the list view
Backend query with "single time query" disabled but no pagination