-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Hi , i'm looking to migrate from MongoDB Atlas Device Sync(realm) to Powersync . I have followed the migration guide which is provided by the official blog and website of powersync itself. I'm facing a strange issue in my app which is a realtime , offline first chat app.
In this , when i send a message i'm performing 3 tasks from frontend associated to it for chat .
- Write the message payload to the local DB(sqlite) via powersync.execute() in the message table.
- Update the last message field of the chat table of local DB with the id of the above last message .
- Update the lastMessageReadTime field on the chat table of local DB with current time when seen for particular user.
I can see that the above transactions seem to perform good mostly when i'm doings chats back and forth at normal pace , like how a normal paced chat is done.
But this gets broken and messages go missing at receiver sides in cases of a group chats or even 1v1 chats when i look to exchange messages rapidly (like keep spamming).
It seems like the uploadData() in the backendConnector is not being called (database.getnextCrudTransaction doesn't return any record) even when the sql update / write transactions complete successfully in the local DB .
Please note that i have checked the backend api's and they are not creating an issue here.
Did anyone else face similar kind of issue ? Or if anyone can help me debug or understand the root cause of messages going missing. Your guidance and help is much appreciated.