Skip to content

fix(feedback): Fix a case where duplicate items can be rendered in the list #95623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

ryan953
Copy link
Member

@ryan953 ryan953 commented Jul 15, 2025

The robots made a comment: #95398 (review)
It points out that we're not de-duplicating result items inside an infinite list when we go to render things.

How could we get duplicate items? If the pagination params are based on offsets (which ours mostly are) then:

  • You fetch the first 10 results (items with id:1, id:2, ... id:10) in the first page
  • In the 2nd page we'll ask for 10 items, starting at the item 10th from the start
    • So we'd expect to get id:11, id:12 and so on

But "start" depends on the sort order, and usually we're showing the most recent stuff first.

  • When sorting newest->oldest our first page of data would actually be something like id: 89, id:88, id:87, etc.
  • The second page we'd expect to be id:79, id:78`, etc.
    • But if a new item appears, and becomes id:90 then everything else shifts down one.
    • So our 2nd page of data actually returns id: 80, id:79, etc.

The end result is that id:80 is double-fetched. This is what we need to filter out of the data.

@ryan953 ryan953 requested a review from a team as a code owner July 15, 2025 23:07
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 15, 2025
@michellewzhang
Copy link
Member

looks like the formatting in the pr description got a little messed up

@ryan953
Copy link
Member Author

ryan953 commented Jul 16, 2025

looks like the formatting in the pr description got a little messed up

it wasn't messed up, just me being lazy and making a mess of it. Cleaned it up now tho

@ryan953 ryan953 merged commit 6abd09c into master Jul 16, 2025
48 checks passed
@ryan953 ryan953 deleted the ryan953/feedback-fix-duplicate-list-items branch July 16, 2025 19:11
Copy link

codecov bot commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #95623      +/-   ##
==========================================
- Coverage   87.69%   84.02%   -3.67%     
==========================================
  Files       10558    10558              
  Lines      608378   608376       -2     
  Branches    23902    23900       -2     
==========================================
- Hits       533496   511190   -22306     
- Misses      74587    96891   +22304     
  Partials      295      295              

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants