Don't drop pub.leaflet documents without publishedAt from post lists#350
Open
jaredpereira wants to merge 2 commits into
Open
Don't drop pub.leaflet documents without publishedAt from post lists#350jaredpereira wants to merge 2 commits into
jaredpereira wants to merge 2 commits into
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
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.
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