Skip to content

Fix: index constituent list (duplicate React keys, blank names) - #5

Open
mpont91 wants to merge 2 commits into
ent0n29:mainfrom
mpont91:fix/fund-constituent-key
Open

Fix: index constituent list (duplicate React keys, blank names)#5
mpont91 wants to merge 2 commits into
ent0n29:mainfrom
mpont91:fix/fund-constituent-key

Conversation

@mpont91

@mpont91 mpont91 commented Aug 25, 2026

Copy link
Copy Markdown

Two problems on the fund page, both caused by aware_psi_index.username being empty for every trader.

Duplicate keys. key={c.username} was "" for all rows:

Encountered two children with the same key, ``.
src/app/fund/page.tsx (596:23)

Now uses rank, which /api/fund/index already returns and is unique within an index.

Blank names. With no username there was nothing to render, so the rows showed an empty name and avatar. /api/fund/index now also returns proxy_address (already present in v_psi_index_current) and pseudonym, joined from aware_trader_profiles. The page falls back username -> pseudonym -> shortened address.

Added an explicit ORDER BY i.weight DESC, since the join would otherwise not be guaranteed to preserve the view ordering that rank is derived from.

Verified locally on PSI-10 and PSI-25: warning gone, ranks correlative and weights still descending, 17/19 constituents resolve to a pseudonym and the rest to an address. tsc --noEmit clean.

Every constituent comes back with an empty username, so the fund page
rendered them all with key="" and React warned about duplicate keys.

Uses rank instead, which the /api/fund/index endpoint already returns and
is unique within an index, and falls back to "Trader #<rank>" so the rows
aren't blank.
username is empty for every trader in aware_psi_index, so the fund page
showed blank rows. /api/fund/index now also returns proxy_address (already
in v_psi_index_current) and the pseudonym joined from aware_trader_profiles.

The page falls back username -> pseudonym -> shortened address. Keeps an
explicit ORDER BY weight DESC so the join doesn't disturb the ranking.
@mpont91 mpont91 changed the title Fix: use rank as React key for index constituents Fix: index constituent list (duplicate React keys, blank names) Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant