All LISTEN
Purpose·Solo

test

# READ BUG — HOMEPAGE GOES EMPTY AFTER 4TH PUBLISHED ARTICLE The public `/read` homepage was working with fewer published articles. After publishing the 4th READ article, `/read` reverted to the empty state:

·With melanie·Guest Lorenzo

Play episode

Show notes

# READ BUG — HOMEPAGE GOES EMPTY AFTER 4TH PUBLISHED ARTICLE

The public `/read` homepage was working with fewer published articles.

After publishing the 4th READ article, `/read` reverted to the empty state:

"The first pages are still being gathered"

This is a functional regression.

Do not redesign READ. Do not change READ Studio. Do not change publishing architecture. Do not change categories, article schema, SSR architecture, SEO, Library, Membership, Growth Plans, LISTEN, Clerk, Stripe, RevenueCat, or navigation.

The likely area to inspect is the recently implemented READ homepage deduplication/editorial selection logic.

-------------------------------------------------- 1. CONFIRM PRODUCTION ARTICLE STATE --------------------------------------------------

Inspect the actual production READ database and public API.

Report:

  • total article count
  • published article count
  • each published article:
  • id
  • title
  • slug
  • category
  • featured
  • priority
  • publishedAt
  • author nullable/author state
  • status

Confirm whether all four published articles are valid for public display.

-------------------------------------------------- 2. TEST PUBLIC READ API --------------------------------------------------

Test the live/current production endpoints:

GET /api/read GET /api/read/articles GET /api/read/categories

Also test each relevant category endpoint.

Determine whether the APIs return all four published articles.

If the API returns the articles correctly, do NOT change backend publishing.

-------------------------------------------------- 3. TRACE HOMEPAGE DEDUPLICATION --------------------------------------------------

Inspect:

artifacts/promise-and-paradise/src/components/read/ReadEditorialHome.tsx

The homepage selection logic currently follows:

  1. Top Story
  2. Editor's Picks
  3. Category sections

and should avoid duplicate articles.

Test exact article counts:

0 1 2 3 4 5 6+ published articles.

Pay special attention to exactly 4 articles.

Verify that: - Top Story selection does not consume or mutate the source array incorrectly - Editor’s Picks selection does not accidentally empty the remaining collection - category grouping does not overwrite the main article list - Set/Map deduplication uses stable article IDs/slugs correctly - no `.splice()` or mutation of shared arrays causes the source data to become empty - no `undefined` Top Story causes the component to select the empty state - featured/priority logic cannot result in `articles.length > 0` but `topStory === undefined` - author-nullability does not exclude otherwise valid articles - no category-specific condition incorrectly requires every article to have a category shelf remaining

The empty state should render ONLY when the public article collection truly contains zero published articles.

-------------------------------------------------- 4. TEST THE EXACT 4-ARTICLE PRODUCTION DATASET --------------------------------------------------

Use the actual four published articles currently in production.

Do not create fake production articles.

Confirm which article should be:

TOP STORY

which articles should become:

EDITOR'S PICKS

and what, if anything, remains for:

CATEGORY SECTIONS

With exactly four articles, a valid expected result could be:

1 Top Story 3 Editor's Picks 0 category sections

That must NOT produce an empty homepage.

-------------------------------------------------- 5. SSR VS CLIENT RENDER --------------------------------------------------

Check both:

  • server-rendered `/read` HTML
  • hydrated browser state

Determine whether:

A. SSR already renders the empty state

or

B. SSR contains articles but client hydration replaces them with the empty state.

Inspect the READ bootstrap payload.

Confirm the bootstrap contains all published articles.

Check browser console and hydration warnings.

-------------------------------------------------- 6. PROTECT THE EMPTY-STATE CONDITION --------------------------------------------------

The empty state must be based only on:

publishedArticles.length === 0

or equivalent trusted public-data result.

It must NOT depend on: - whether a Top Story could be selected - whether Editor’s Picks exist - whether category sections exist - whether featured placement exists

If articles exist but no special editorial placement can be determined, fall back gracefully to a standard valid story presentation.

Do not show the empty state when published articles exist.

-------------------------------------------------- 7. VERIFY FEATURED + PRIORITY LOGIC --------------------------------------------------

Inspect all four current articles for:

featured priority

Confirm that: - multiple featured articles are handled safely - zero featured articles are handled safely - duplicate priority values are handled safely - null/zero priority values are handled safely

Do not require exactly one featured article unless the current schema explicitly enforces that.

-------------------------------------------------- 8. CATEGORY EDGE CASES --------------------------------------------------

Test: - four articles all in one category - four articles across multiple categories - categories with only articles already consumed by Top Story/Editor's Picks - no remaining unique articles for category sections

In all cases, `/read` must still render whatever unique articles are available.

-------------------------------------------------- 9. APPLY THE SMALLEST FIX --------------------------------------------------

Once the root cause is found, change only the READ homepage selection/rendering logic necessary to fix it.

Do not alter: - article records - production article content - database schema - public API contracts - Studio publishing - article pages - category pages - SSR architecture - sitemap - security

-------------------------------------------------- 10. REQUIRED REGRESSION MATRIX --------------------------------------------------

After fixing, verify `/read` with:

0 articles 1 article 2 articles 3 articles 4 articles 5 articles 10+ articles

Expected:

0 → intentional empty state 1 → Top Story only 2 → Top Story + one Editor's Pick 3 → Top Story + up to two Editor's Picks 4 → Top Story + up to three Editor's Picks 5+ → Top Story + Editor's Picks + remaining unique category content where available

No published article should disappear because of deduplication.

No article should repeat unnecessarily.

-------------------------------------------------- 11. VERIFY CURRENT REAL ARTICLES --------------------------------------------------

After the fix, confirm the current real production articles:

  • appear on `/read`
  • still open on their article URLs
  • still appear on category pages
  • remain deduplicated on `/read`
  • survive hard refresh
  • render through SSR
  • hydrate without mismatch

-------------------------------------------------- 12. COMPLETION REPORT --------------------------------------------------

Return:

A. Root cause

B. Production article count/state

C. API results

D. Exact 4-article failure mechanism

E. Fix applied

F. Files changed

G. SSR/hydration result

H. 0/1/2/3/4/5/10+ article test matrix

I. Confirmation that current production articles now render

J. Confirmation no unrelated systems were modified