habitica-android
habitica-android copied to clipboard
Liking messages in party chat doesn't always update like count as expected
Describe the bug I was fixing the issue in #1861 and noticed that while the click callback was being called and we were contacting server to update the message likes, the like count does not always react to these changes in the list. I'm separating this out into its own bug report since it doesn't involve the touch target issue from #1861.
To Reproduce Steps to reproduce the behavior:
- Open a party chat.
- Like or unlike someone else's message.
- Repeat until like count does not update as expected.
Expected behavior The like count should update each time that you like and unlike the message.
Screenshots
(clicking on an emulator often through this recording, some updates show and some don't).
Smartphone (please complete the following information):
- Device: Pixel 7 emulator
- OS: API 33
- App Version: develop, cc5cd88
- Habitica Username: jsoberg
Additional context
There appear to be a few issues here that I can see at an initial glance:
-
SocialRepositoryImpl.likeMessage
always returns null, and therefore we never submit an update for that message inGroupViewModel.likeMessage
. -
RealmSocialLocalRepository.likeMessage
doesn't update when the message is already liked, so when we go from liked to unliked we don't make any local changes.
After addressing these issues locally and doing a little debugging, it seems like the message returned from apiClient.likeMessage
still ends up not being changed on some calls, so I'm wondering if this could also potentially be an issue on the server and/or an issue with submitting the change within a certain time interval and being ignored.