fix: deduplicate posts in feed to prevent duplicate rendering#5577
Merged
fix: deduplicate posts in feed to prevent duplicate rendering#5577
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
fc03b4d to
ac9045c
Compare
rebelchris
reviewed
Feb 25, 2026
| const plusEntryAsFirstCard = settings?.plusEntry?.flags?.asFirstCard; | ||
|
|
||
| if (feedQuery.data) { | ||
| const seenPostIds = new Set<string>(); |
Contributor
There was a problem hiding this comment.
I'm not against it but just waiting for Ante to check the API part
ac9045c to
75f21ed
Compare
75f21ed to
c29de1b
Compare
c29de1b to
1d7c0a1
Compare
rebelchris
approved these changes
Feb 26, 2026
Add a Set-based dedup in the items useMemo as a defensive fallback. When pages contain overlapping posts (e.g. stale cursor returns first page content as page 2), duplicates are now skipped client-side.
1d7c0a1 to
17f6230
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
useFeedhook'sitemsuseMemoWhy
When feed cache regenerates mid-session, the stale cursor response returns first-page content as a subsequent page. Even with the
staleCursor→resetQueriesmechanism, there's a brief render window where duplicate pages coexist. This client-side dedup ensures users never see duplicate posts regardless of backend timing.Related
Test plan
Preview domain
https://fix-feed-dedup-fallback.preview.app.daily.dev