Skip to content

Bug: Like count is double-counted after opening Liked Items or refreshing Home #468

Description

@VitaliiKoliuka

Environment

  • Branch: main
  • Commit: 033379c
  • Device: Vivo V2027
  • Android: 10
  • Test type: Manual testing on a physical Android device

Preconditions

  • User is logged in.
  • The tested product initially displays an outlined heart and like count 0.

Steps to reproduce

  1. Open Home.
  2. Tap the product heart once.
  3. Open Profile → Liked.
  4. Return to Home.
  5. Refresh the Home feed.
  6. Tap the same product heart once to unlike it.
  7. Refresh the Home feed again.
  8. Open Profile → Liked.

Actual result

  1. After the first like:

    • the heart becomes red;
    • the count changes from 0 to 1.
  2. In Profile → Liked:

    • the product appears once;
    • the heart is red;
    • the count displays 2.
  3. After returning to Home:

    • the heart is red;
    • the count displays 1.
  4. After refreshing Home:

    • the heart remains red;
    • the count changes to 2.
  5. After tapping the heart once to unlike:

    • the heart becomes outlined/white;
    • the count changes from 2 to 1.
  6. After refreshing Home again:

    • the heart remains outlined/white;
    • the count changes to 0.
  7. In Profile → Liked:

    • the empty state is displayed;
    • the product is no longer present.

Expected result

  • After liking a product with an initial count of 0, screen should display a red heart with count 1.
  • Opening Profile → Liked should display a red heart with count 1.
  • Refreshing Home should display a red heart with count 1.
  • After unliking, the heart should become outlined and the count should immediately change to 0.
  • Home and Profile → Liked should always show consistent data.

Reproducibility

Reproduced on the merged main branch on a Vivo V2027 physical device.

Impact

The like and unlike actions are persisted correctly, but the displayed count is inconsistent and temporarily double-counted across Home and Profile → Liked.

Evidence

video.Like.count.mp4

Related work

Observed after the liked-items implementation from PR #458 was merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions