habitica-android
habitica-android copied to clipboard
Can't Read Older PMs
User report:
"Device: Sony F5321 Android Version: 25 AppVersion: Version 3.5 (3237) BETA User ID: 33bb14bd-814d-40cb-98a4-7b76a752761c Level: 95 Class: rogue Is in Inn: false Uses Costume: true Custom Day Start: 16 Timezone Offset: -60 Details:
Hello 😊.
I just noticed that it is not possible to read past PMs. Not talking about the most recent ones, but those that are older, those that you have to load first. If you load, the old PMs appear, but they don't stay for too long. The screen jumps back down and unloads the PMs again.
It might not work to replicate the issue for the first loaded PM batch. Might need a few batches. I was trying to read through conversations that took place 6-8 months ago. If you need more accurate time frames or numbers of loaded PMs, I was trying to read through my PM history with @jjgame83 (challenge/pixel art related conversations)."
👀
This seems to be happening because there's a 30 second refresh interval set (code) that invalidates the data source on this interval. So every 30 seconds, no matter where you are in the conversation, the data source will invalidate and will reload the newest page again.
This isn't a simple fix however because this 30 second interval is the only thing that seems to drive new messages appearing when you have the chat open. A fix for this would require something like listening to our chat pages from an underlying database vs network paging directly (example talking about Room, but I believe Realm can afford the same functionality) where we're checking for updates on an interval/from notifications in the network layer instead of the UI, which will then update the DB and automatically update the UI.
#1399 appears to be related to this
we have some planned improvements to chat in the future that will reduce the amount of reloading and may address this. will come back and check when we're testing it.