You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app with a chat page. The chat page itself is grouped by rooms, e.g. another user. When the chat screen is opened and I receive a message, it works fine, also when the app is closed and I receive a message and I open the chat page it is updated properly.
But when the app is in background with a given chat page, e.g. with USER1 and a message is received and stored and I open the chat page, the stream is not updated properly. I think it is due to the fact that stream queries are cached and in the background it isn't synced. Because when I query the messages without stream as soon as the chat page is opened, it works fine.
Is it possible to force the stream implementation to "query" and not to use the cache somehow? Or is there another solution to trigger the stream to sync it?
Otherwise I would have to do an implementation that updates the messages in the chat page with the future query instead of the stream query and then starting the stream again.
The text was updated successfully, but these errors were encountered:
Is it possible to force the stream implementation to "query" and not to use the cache somehow? Or is there another solution to trigger the stream to sync it?
You can use this on your database to update all streams manually:
db.notifyUpdates(
{for (final table in db.allTables) TableUpdate.onTable(table)});
I think it is due to the fact that stream queries are cached and in the background it isn't synced
They are being cached, but that cache should invalidate after a write to the database. Are you using a separate database connection for the writes in the background?
Closing this since I can't act on this without further information. Let me know if you still run into this (and also share how the writes are happening so that I have a starting point to look into).
I have an app with a chat page. The chat page itself is grouped by rooms, e.g. another user. When the chat screen is opened and I receive a message, it works fine, also when the app is closed and I receive a message and I open the chat page it is updated properly.
But when the app is in background with a given chat page, e.g. with USER1 and a message is received and stored and I open the chat page, the stream is not updated properly. I think it is due to the fact that stream queries are cached and in the background it isn't synced. Because when I query the messages without stream as soon as the chat page is opened, it works fine.
Is it possible to force the stream implementation to "query" and not to use the cache somehow? Or is there another solution to trigger the stream to sync it?
Otherwise I would have to do an implementation that updates the messages in the chat page with the future query instead of the stream query and then starting the stream again.
The text was updated successfully, but these errors were encountered: