Skip to content

Bug: Duplicate User List Rendering on Navigating Back to / Route After Clicking Member Card #196

@mridxl

Description

@mridxl

Issue Description

When navigating to the /member/<member-id> route by clicking on a member's card on the / route, and then navigating back to the / route (without a hard refresh), the list of new users is rendered twice instead of once. This happens because the https://api.realdevsquad.com/users API is refetched each time the user navigates back to the / route, causing the same users to be appended to the list multiple times. The behavior is inconsistent, as the API is sometimes refetched and sometimes not.

Expected Behavior

When navigating back to the / route, the list of new users should be rendered only once. The user list should not be duplicated.

Current Behavior

Upon navigating back to the / route, the https://api.realdevsquad.com/users API is refetched, and the same users are appended to the list, causing the users to be rendered multiple times. This behavior is inconsistent, as the API is not always refetched.

Screenshots

Image

Environment

  • Operating System: Windows
  • Browser (if applicable): Chrome
  • Version of Software/Project: [e.g., v1.0.0]

Additional Information

  • The re-fetching behavior is inconsistent and does not occur every time.
  • In testing, the issue has been difficult to reproduce consistently.
  • The issue only occurs when navigating to /member/<member-id> by clicking on a member's card. Directly typing the URL does not trigger the problem.

Checklist

  • I have read and followed the project's code of conduct.
  • I have searched for similar issues before creating this one.
  • I have provided all the necessary information to understand and reproduce the issue.
  • I am willing to contribute to the resolution of this issue.

Steps to Reproduce

  1. Go to the members site]
  2. Click on a member's card to be redirected to members.realdevsquad.com/<member-id>.
  3. Navigate back to the / route without a hard refresh.
  4. Observe that the new users are rendered twice.

Possible Solutions

Ensure that the state is properly managed so that the user list is not duplicated. Making sure that we are not appending to the user's list and instead re-setting the state should fix the issue.

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