Infinite Scroll, Infinite Repeats — JavaScript Bug Hunt

Inspired by every infinite feed that shows you the same clip twice.

  • Language: JavaScript
  • Layer: Frontend
  • Difficulty: Easy
  • Concepts: Pagination, Dedupe
  • Modelled on: TikTok feeds
  • Visible tests: overlapping items appear once; disjoint pages append cleanly
  • Reward: 50 XP for a complete fix

Briefing

Inspired by every infinite feed that shows you the same clip twice. Page boundaries shift while you scroll (new posts push everything down), so incoming pages overlap what's already rendered.

feedMerge.js must append only the truly-new items, preserving order.

Bug report

BUG-∞ · Reported by: feed QA

mergePage(existing, incoming) contract:

  • keep every existing item, in order
  • append only incoming items whose id is not already present, in their order

Observed: raw concatenation — users see duplicates on every page boundary.

Logs

[feed] rendered ids: [8,7,6,5, 6,5,4,3]  <- 6 and 5 repeated

The code as shipped

src/feed/feedMerge.js (editable)

// Appends an incoming page to the already-rendered feed.
exports.mergePage = function (existing, incoming) {
  return existing.concat(incoming);
};

Open the hunt to edit the files, run the visible tests and submit against the hidden ones. More JavaScript bug hunts.