Skip to content

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

@wax911

Description

@wax911

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    πŸ“‹ Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions