Skip to content

Don't drop pub.leaflet documents without publishedAt from post lists#350

Open
jaredpereira wants to merge 2 commits into
mainfrom
claude/document-rendering-regression-igr6x7
Open

Don't drop pub.leaflet documents without publishedAt from post lists#350
jaredpereira wants to merge 2 commits into
mainfrom
claude/document-rendering-regression-igr6x7

Conversation

@jaredpereira

Copy link
Copy Markdown
Contributor

Every post-list surface (publication home, archive, posts-list blocks,
dashboard, RSS, tag pages, reader feed) funnels documents through
normalizeDocument, which returned null for pub.leaflet.document records
missing publishedAt — an optional field in that lexicon. Documents that
only exist under pub.leaflet.document (third-party publishers) could
legitimately lack it and silently vanished from every list, while
site.standard.document records could never hit the drop since their
lexicon requires publishedAt.

Normalize such records with publishedAt left undefined instead: every
consumer already guards missing dates (sorting falls back to epoch, date
display is conditional, prev/next links filter undated docs), so only
the type needed loosening. NormalizedDocument uses OmitKey rather than
Omit because the generated Record's index signature makes plain Omit
collapse every known key to unknown.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_011UUDcdHkoLxf1bVFhriAFD

Every post-list surface (publication home, archive, posts-list blocks,
dashboard, RSS, tag pages, reader feed) funnels documents through
normalizeDocument, which returned null for pub.leaflet.document records
missing publishedAt — an optional field in that lexicon. Documents that
only exist under pub.leaflet.document (third-party publishers) could
legitimately lack it and silently vanished from every list, while
site.standard.document records could never hit the drop since their
lexicon requires publishedAt.

Normalize such records with publishedAt left undefined instead: every
consumer already guards missing dates (sorting falls back to epoch, date
display is conditional, prev/next links filter undated docs), so only
the type needed loosening. NormalizedDocument uses OmitKey rather than
Omit because the generated Record's index signature makes plain Omit
collapse every known key to unknown.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UUDcdHkoLxf1bVFhriAFD
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
minilink Ready Ready Preview, Comment Jul 11, 2026 12:33am

Request Review

A publication can be indexed under both its site.standard.publication
and legacy pub.leaflet.publication URIs (migration intentionally keeps
the old rows), and each document links in documents_in_publications to
whichever variant its own record names. Every listing surface resolved
one publications row (.order uri desc puts site.standard first) and read
only that row's embedded links — so a document that only has a
pub.leaflet.document record, linked to the legacy publication URI,
vanished from the publication home page, archive, posts-list blocks,
RSS, sitemap, dashboard, and search, while its post page (which starts
from the documents table) kept rendering fine.

Fetch documents_in_publications for both URI variants of the resolved
publication instead, deduping documents that exist under both namespaces
(preferring the site.standard copy) so migrated posts don't double-list:

- fetchPublicationForPage (home page, /archive, published-page
  posts-list blocks)
- generateFeed (rss/atom/json)
- per-domain sitemap.xml
- get_publication_data (dashboard posts list; merged links reattached to
  the returned publication for the theme-preview client)
- search_publication_documents

The bsky feed generator (lish/feeds), reader getSubscriptions, and the
post page's prev/next embed still read a single row's links and could
get the same treatment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UUDcdHkoLxf1bVFhriAFD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants