Skip to content
This repository was archived by the owner on Jul 13, 2024. It is now read-only.
This repository was archived by the owner on Jul 13, 2024. It is now read-only.

Use hash as key instead hashAbbrev in @gitgraph/react #321

@soumyart

Description

@soumyart

Describe the bug
While rendering commits, gitgraph-react uses hashAbbrev as key, which is a truncated version of commit hash. Different commit hash with same prefix returns same hashAbbrev. Which leads to same key panic error in react.

https://github.com/nicoespeon/gitgraph.js/blob/master/packages/gitgraph-react/src/Gitgraph.tsx#L217

Every server/database can't produce git like commit hash.

To Reproduce
Provide different string having same initials as commit hash.
Ex.

master.commit({hash: "5c7fb1924868ac6d7e45430a"});
master.commit({hash: "5c7fb1924868ac1a0b45430b"});

https://codesandbox.io/s/gitgraph-react-same-key-error-x3j3b

Expected behavior

There shouldn't be any error on console.

Screenshots

image

Context

  • Library @gitgraph/react
  • version 1.5.1

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 BugUnexpected behavior to be fixed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions