AniTrend / anitrend-v2

Rewrite project for AniTrend 🔥
GNU General Public License v3.0
46 stars 6 forks source link

[app-data] Fix notification counter database logic to assure updates are persisted #183

Open wax911 opened 1 year ago

wax911 commented 1 year ago

AniTrend Issue Guidelines

Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.

You may find an answer in already closed issues: https://github.com/AniTrend/anitrend-v2/issues?q=is%3Aissue+is%3Aclosed

Description of Bug

Notification counter in the navigation drawer never seems to get updated despite API response data reflecting changes, unless you logout and login again.

Reproduction Steps

Screenshots

Screenshot_20220717_133132

Additional Context

We utilise relations to combine the user and notification entity tables https://github.com/AniTrend/anitrend-v2/blob/bf2d52ddfc4d0523d4127230317c02a15f92e53f/app-data/src/main/kotlin/co/anitrend/data/user/entity/view/UserEntityView.kt#L42-L49

wax911 commented 4 months ago

Perhaps it's easier to use a simple shared prefs to store our notification unread count, that way we don't need to concern our selfs with complex database queries