Skip to content

BUG: Duplicate React keys in AI Tagging view (FaceCollections.tsx) #888

@amish-kumar-07

Description

@amish-kumar-07

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Description

React reports duplicate key values when rendering face clusters in the AI-tagging section. Since React relies on unique keys to correctly track component identity, this may lead to unstable UI behavior or unexpected rendering issues.


Location

/src/components/FaceCollections.tsx


Console Warning

Encountered two children with the same key, `xxxxx`.
Keys should be unique so that components maintain their identity across updates.

Screenshot

Image

Steps to Reproduce

  1. Navigate to the AI-Tagging section
  2. Load the face clusters
  3. Open the browser console
  4. Observe the React warnings about duplicate keys

Expected Behavior

Each rendered list item should have a unique and stable key value.


Actual Behavior

React logs warnings about duplicate key props when rendering cluster items. This may cause components to render incorrectly or lose their identity across updates.


Possible Cause

The key prop appears to be generated from a value that is not guaranteed to be unique or stable across the list.


Suggested Fix

Ensure the key is always unique. For example:

{ clusters.map((cluster: any, i: number) => (
  <div key={`${cluster.cluster_id}-${i}`}>

Alternatively, if cluster_id is guaranteed unique, it can be used directly.


Environment

  • Browser:
  • OS:
  • App version / commit hash:

Additional Context

I’d be happy to help test or submit a PR for this fix.

Record

  • I agree to follow this project's Code of Conduct

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