Skip to content

IssueDetailPage's team payout splits use split.role as the React key, causing duplicate keys when multiple contributors have no assigned role #244

Closed

Description

@chonilius

src/app/issues/[id]/page.tsx#IssueDetailPage renders each team split like this:

{bounty.teamSplits.map((split) => (
  <div key={split.role} className="flex items-center justify-between ...">
    <span>{split.role}{split.contributor ? ` (${split.contributor})` : ""}</span>
    <span>{split.percentage}%</span>
  </div>
))}

key={split.role} assumes each split's role is unique within a bounty. But
src/lib/adapters.ts#adaptBounty defaults a missing role to a fixed literal:

const splits = raw.team?.splits?.map(
  (split): TeamSplit => ({
    role: split.role ?? "Contributor",
    ...
  }),
);

Any bounty with two or more team-split entries that both lack an explicit role on the
backend (a plausible, unremarkable case — e.g. two people simply added to a split with no
formal role assigned yet) ends up with two TeamSplit objects that both have
role: "Contributor", producing a duplicate React key. React will warn in the console
and may reuse/misattribute DOM state between the two rows during updates (e.g. after
router.refresh() following a fund/claim action), potentially showing one contributor's
percentage against the other's name if the list re-renders with reordered data.

Suggested fix: key on something guaranteed unique per split — e.g.
key={${split.role}-${split.contributor ?? "unassigned"}-${index}} — rather than
role alone.

Activity

  1. added
    bug
    spike
    help wanted
    architecture
    on Aug 21, 2026
  2. added
    Stellar Wave
    on Aug 24, 2026
  3. dolaoluwa574-source commented on Aug 24, 2026

    @dolaoluwa574-source

    @dolaoluwa574-source has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Allow me fix this quickly

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @dolaoluwa574-source to this issue.

  4. OutstandingVick commented on Aug 24, 2026

    @OutstandingVick

    @OutstandingVick has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hi! I’d love to contribute to MergeFi and take ownership of this rendering stability fix.

    I’ll replace the non-unique split.role key with a stable unique key for each payout split, then add focused coverage for multiple contributors sharing the fallback "Contributor" role to ensure React no longer emits duplicate-key warnings or misattributes rows during re-renders.

    I’m excited to contribute and collaborate with the team. Please assign this issue to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @OutstandingVick to this issue.

  5. abrahambaba1 commented on Aug 24, 2026

    @abrahambaba1

    @abrahambaba1 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    hi, I'd love to contribute to this , please assign this issue to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @abrahambaba1 to this issue.

  6. drips-wave commented on Aug 24, 2026

    @drips-wave

    Congratulations, @presidoclintonbased-alt! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @presidoclintonbased-alt: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  7. drips-wave commented on Aug 25, 2026

    @drips-wave

    This issue has been completed by @presidoclintonbased-alt as part of the Stellar Wave Program's 8th Wave 🥳

    😎 @presidoclintonbased-alt: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  8. removed
    Stellar Wave
    on Oct 15, 2026
  9. added
    Stellar Wave
    on Oct 15, 2026
  10. removed
    Stellar Wave
    on Oct 15, 2026
  11. added
    Stellar Wave
    on Oct 15, 2026
  12. removed
    Stellar Wave
    on Oct 15, 2026
  13. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar Wavearchitecturebughelp wantedspike

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions