Skip to content

Fix Trending column piling up duplicate rows - #574

Merged
dimdenGD merged 1 commit into
dimdenGD:mainfrom
hiver:fix-trending-duplicate-rows
Nov 13, 2026
Merged

dimdenGD merged 1 commit into
dimdenGD:mainfrom
hiver:fix-trending-duplicate-rows

Conversation

@hiver

@hiver hiver commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

The Trending column sometimes shows the same trend many times, and the copies keep piling up until the tab is reloaded.

Cause

TrendsList renders its rows with key: e.name, and trends/plus.json sometimes returns the same trend name twice. With two rows sharing a key, React 16 loses track of one of the old rows whenever the order above them changes, so each such refresh leaves one stale row behind.

Fix

Keep only the first trend of each name before rendering (one spot in files/bundle.js). Ranks and order are unchanged.

How it was tested

  1. The real TrendsList render callback from files/bundle.js was called with six trends named A, B, A, C, B, D: 6 rows before (two pairs of duplicate keys), 4 rows after (A, B, C, D).
  2. A 20-item list was rendered with the bundled React 16.6.3, keyed the same way, and re-rendered 30 times:
list rows after 30 refreshes
unique names 20
one name twice, same order every time 20
one name twice, two ranks above it swapping 49 (31 copies of that name)
same, with this fix 19

There is no console error to attach: the production React build does not warn about duplicate keys.

In daily use, dropping the repeated names from the response before OTD renders it (the same effect as this change) stopped the pile-up for me.

Not tested: the patched bundle in a live, logged-in OTD session.

I used Claude (an AI assistant) to track this down, write the fix and run the tests above.

TrendsList keys its rows by trend name, and trends/plus.json sometimes
returns the same name twice. With two rows sharing a key, React 16 leaves
a stale row behind whenever the order above them changes, so the copies
pile up until the tab is reloaded.

Keep only the first trend of each name before rendering. Ranks and order
are unchanged.
@dimdenGD
dimdenGD merged commit 9c2c7a5 into dimdenGD:main Nov 13, 2026
1 check passed
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.

2 participants