Skip to content

BUG: Profile State Mutation Causes Incorrect User Data in Tutorial Cards #238

@muntaxir4

Description

@muntaxir4

Is your bug related to a problem? Please describe.
The components CardWithPicture.jsx and CardWithoutPicture.jsx depend on profile.user from the root state to display the profile picture and display name of tutorial authors. This causes unintended side effects:

  1. Incorrect User Data – When tutorials from multiple users appear in the feed, their profile picture and name can be incorrectly replaced when profile.user updates.
  2. Unnecessary Re-renders – Since the profile state is global, every update triggers a re-render of all tutorial cards, leading to performance issues.

Steps to Reproduce:

  1. Open the tutorial feed containing multiple users.
  2. Observe that some tutorial cards show the wrong profile picture or name.

Expected Behavior:

  • Each tutorial card should display the correct author's name and profile picture, independent of global state updates.
  • Fetching a profile should not alter existing tutorial cards in the feed.

Describe the solution you'd like

  • Modify getUserProfileData() to return the requested user object instead of updating global state.
  • Store profile details locally within each tutorial card instead of relying on profile.user.

Additional context
This issue significantly affects UX, causing misleading author information in the tutorial feed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions