Skip to content

fix: Resolve stale ProductList data after review submission #14

@Eren-Can-Donertas

Description

@Eren-Can-Donertas

Description

A state synchronization issue has been identified where the ProductList screen displays stale data (review counts and ratings) after a user successfully submits a review. Currently, the application fails to update the local cache or state upon navigating back to the product list, requiring a manual refresh or full reload to see the changes.

Correcting this is critical to ensure users receive immediate feedback and to maintain the integrity of social proof (reviews/ratings) across the platform.


Ownership, Deadline & Effort

  • Team Owner: Engineering
  • Individual Owner: @MehmetBegun
  • Deadline: 2026-01-26 24:00 (End of day, explicitly stated)
  • Estimated Effort: 4 hours

Deliverables

  • State Synchronization Fix: Updated logic to ensure ProductList data is refreshed or updated upon successful review submission.
  • Verification Report: Confirmation that reviewCount and averageRating are consistent with backend data without manual refresh.
  • Platform Validation: Proof of fix on at least one platform (Web, Android, or iOS).

Scope

In Scope:

  • Identifying the specific state management or caching mechanism causing the stale data.
  • Implementing a trigger to update or invalidate the product list cache after a successful review.
  • Ensuring the averageRating calculation (if done client-side) or fetch reflects the latest backend data.
  • Verifying state consistency during navigation.

Out of Scope:

  • UI/UX redesign or layout changes to the product cards.
  • New feature development for the Reviews module.
  • Backend API changes (unless a data gap is discovered during investigation).

Acceptance Criteria

  • ProductList reflects the updated reviewCount immediately after a successful review submission.
  • averageRating values match the latest backend response.
  • No stale data remains visible after navigating back to the ProductList.
  • The fix is verified to work without requiring a manual "pull-to-refresh."
  • The solution does not introduce redundant API calls for unrelated products in the list.

Domain-Specific Notes: Engineering

  • Caching: If using a library like React Query or SWR, ensure the specific product cache key is invalidated or updated via optimistic updates.
  • Navigation: Verify if the navigation listener (e.g., onFocus or componentDidMount) needs to trigger a partial re-fetch.
  • Data Consistency: Ensure the data types for reviewCount and rating match between the Review submission response and the Product List schema.

Validation / Review Requirements

  • Validation: Manual end-to-end test: Submit a review and verify the count change on the list immediately upon return.
  • Required Reviewers: Frontend Lead or Senior Mobile Engineer.
  • Definition of Done: Code is merged into the main branch and the bug is verified on a physical device or emulator.

Additional Context

  • Current Behavior: Users must manually refresh the page to see their review reflected in the total count.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions