Infinite Scroll, Infinite Repeats

Easy

· Frontend

Incident

SEV-3

Time to fix: 10 min

Failing checks on the shipped build

  • overlapping items appear once

    expected [8,7,6,5,4] but got [8,7,6,6,5,4]

How to work this incident

  1. Read the report: write down the expected behaviour and the actual one in a sentence each.
  2. Reproduce it: run the visible tests and find the failing check that matches the report.
  3. Read the logs and the failing checks for the first value that is wrong — the earliest wrong value is nearer the cause than the loudest error.
  4. Follow the value the screen shows back through the state and the pure helpers that compute it; the view is usually only the messenger.
  5. Fix the cause rather than the symptom, run the visible tests again, and submit against the hidden ones — then write the root cause down.

Inspired by

TikTok feeds

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.

Code map

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

Sign in to edit the file, run the tests and submit a fix

A free account — no card, no trial clock. You come straight back here.

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

Incident

  • Severity: SEV-3
  • Time to fix: 10 minutes, the target for an easy incident

Failing checks on the shipped build

  • overlapping items appear once — expected [8,7,6,5,4] but got [8,7,6,6,5,4]

How to work this incident

  1. Read the report: write down the expected behaviour and the actual one in a sentence each.
  2. Reproduce it: run the visible tests and find the failing check that matches the report.
  3. Read the logs and the failing checks for the first value that is wrong — the earliest wrong value is nearer the cause than the loudest error.
  4. Follow the value the screen shows back through the state and the pure helpers that compute it; the view is usually only the messenger.
  5. Fix the cause rather than the symptom, run the visible tests again, and submit against the hidden ones — then write the root cause down.

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 start the incident clock, edit the files, run the visible tests and submit against the hidden ones, then write the root cause down. More JavaScript bug hunts.