Fetch messages in background
- fixes #4381
Fetches messages and saves them when refreshing the conversation list. Only refreshes what is needed, to save battery.
🏁 Checklist
- [ ] ⛑️ Tests (unit and/or integration) are included or not needed
- [ ] 🔖 Capability is checked or not needed
- [ ] 🔙 Backport requests are created or not needed:
/backport to stable-xx.x - [ ] 📅 Milestone is set
- [x] 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)
not to be merged for 20.1.0, might review only afterwards
fyi @rapterjet2004 i rebased on master...
will do some testing tomorrow, then it should be fine to merge
sorry Julius i won't merge this PR.
There were just too many things wrong when i tested (messages that i expected to be there were missing / Messages were loaded from when conversation was created / ...)
Also the calculation with the previous/current/result lists doesn't make sense to me. Why is only the difference to the last state counted? If the unread messages are missing, we want to have them all.
Tbh i would like to close the PR for now and we should have a fresh look at it later.
Rewrote and simplified the updateRoomMessages, couldn't replicate the other errors. Can you point me in the right direction?
Rewrote and simplified the
updateRoomMessages, couldn't replicate the other errors. Can you point me in the right direction?
hope to find time for this one soon! can you rebase and solve the merge conflicts?
Codacy
Lint
| Type | master | PR |
| Warnings | 100 | 100 |
| Errors | 9 | 9 |
SpotBugs
| Category | Base | New |
|---|---|---|
| Bad practice | 6 | 6 |
| Correctness | 222 | 222 |
| Dodgy code | 71 | 71 |
| Internationalization | 3 | 3 |
| Malicious code vulnerability | 3 | 3 |
| Performance | 4 | 4 |
| Security | 1 | 1 |
| Total | 310 | 310 |
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4475-talk.apk
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.