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

BUG: User Profile store overwrites data and Hardcoded User in comments #218

Open
muntaxir4 opened this issue Feb 22, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@muntaxir4
Copy link
Contributor

muntaxir4 commented Feb 22, 2025

Is your bug related to a problem? Please describe.
There are two key issues related to user profile data handling:

  1. Profile Store Overwriting Issue: The UserDetails.jsx component uses getUserProfileData, which updates the user state for every fetch. As a result, only a single user can be stored in the profile store at a time, leading to data being overwritten when switching between profiles.
  2. Hardcoded User in Comments: In Comment.jsx and TutorialPage/index.jsx, the comment creation process currently uses a hardcoded user (codelabzuser) instead of dynamically using the authenticated user's handle.

Steps to Reproduce:

  1. Navigate to someone's tutorial.
  2. Comment something.
  3. Observe every user getting changed to logged in user. Even the post's user gets changed.

Expected Behavior:

  • User profiles should be stored independently to allow different profiles.
  • The comment creation logic should use the actual authenticated user’s handle instead of a hardcoded value.

Describe the solution you'd like

  1. Modify UserDetails.jsx to prevent overwriting the profile store or providing check statements to only update the current component if userId matches with the fetched one.
  2. Update Comment.jsx and TutorialPage/index.jsx to use userHandle dynamically for comment creation instead of the fixed codelabzuser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant