Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wax911 opened this issue Dec 19, 2022 · 1 comment
Labels
🐛 bug Something isn't working 🆘 help wanted Extra attention is needed
Milestone

Comments

@wax911
Copy link
Member

wax911 commented Dec 19, 2022

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

  • Login to your AniList account and make a mental note of what the unread notification count is
  • Interact with the app or website to get the notification count to increase
  • Check the app and make sure that at least one notification check/profile request has been made
  • See the notification count upon expanding the navigation drawer, notice that the unread amount doesn't change

Screenshots

Screenshot_20220717_133132

Additional Context

  • See notification provider for UI controller for icon and counter logic
  • See data source class responsible for managing requests and persistence of the viewer class
  • See notification entity reference table that holds the user_id and notification count for a given user_id, this is only applicable to the authenticated accounts/profiles

We utilise relations to combine the user and notification entity tables

internal data class Authenticated(
@Embedded override val user: UserEntity,
@Relation(
parentColumn = "id",
entityColumn = "user_id"
)
val notification: UserNotificationEntity,
) : UserEntityView()

@wax911 wax911 added the 🐛 bug Something isn't working label Dec 19, 2022
@wax911 wax911 added this to the v2.0.0-alpha milestone Dec 19, 2022
@wax911 wax911 changed the title Fix notification counter database logic to assure updates are persisted [app-data] Fix notification counter database logic to assure updates are persisted Dec 31, 2022
@wax911 wax911 moved this to 📋 Backlog in anitrend-v2 Jan 15, 2023
@wax911 wax911 added the 🆘 help wanted Extra attention is needed label Mar 25, 2024
@wax911
Copy link
Member Author

wax911 commented Mar 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🆘 help wanted Extra attention is needed
Projects
Status: 📋 Backlog
1 participant