Carry a contact's provenance, which the crawler was failing without - #141
Merged
Conversation
…140) Every crawl of a feed that publishes a contact address but names nobody has been failing at the write since author enrichment shipped. In the hour this was found, 985 of 1,385 crawls errored; the queue stopped draining and /crawlstats went with it. `feedContacts` built each contact as `{ url, network }` and dropped the channel element it came from. Both `feed_links.source` and `author_links.source` are `not null`, so the statement bound `undefined` -- which the remote libSQL client will not serialize at all. It throws `Unsupported type of value` before any SQL runs, with no column named and no row to point at, and the crawl recorded it as `could not be crawled`: a publisher who looks down. The population is large and it is not a platform quirk. Any feed with a `<webMaster>` or `managingEditor` address whose name fails the person test takes this path -- WordPress and Substack alike, and Substack additionally names nobody else, so every newsletter on it qualified. Nothing caught it because the local SQLite driver the tests use binds `undefined` as null without complaint. The difference only exists on the wire, so `link-binds.test.js` asserts what the remote client accepts rather than what a local write happens to survive. Two fixes, because either alone leaves a hole: contacts now carry `source` (provenance worth keeping in its own right -- a mailbox from `itunes:owner` is a stronger claim than one from `webMaster`), and the four link bind sites default it, so no caller can put an unbindable value in a not-null column again. Also: a newsletter whose host fills in the iTunes block is no longer a podcast. Substack emits `<itunes:owner>` on every publication it serves and nothing else that looks like a show -- no `itunes:type`, no `podcast:` namespace, image enclosures rather than audio -- and that one tag filed the whole platform under /podcasts. This is the correction the video branch already makes: the tag has to be corroborated by what the feed actually ships. A declared show still stands on its own, so a podcast that has not released an episode yet keeps its category. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What was happening
The crawler was not slow. It was failing: 985 of 1,385 crawls in the hour this was found errored, every one of them with
could not be crawled — Unsupported type of value. Each failure still costs two write slots (the failed transaction, thenmarkCrawlFailure) and stores nothing, so the queue stopped draining and/crawlstatswent with it — the API was taking 30–60s to answer.Root cause
feedContactsbuilt each contact as{ url, network }and dropped the channel element it was read from. Bothfeed_links.sourceandauthor_links.sourcearenot null, so the statement boundundefined.The remote libSQL client will not serialize
undefinedat all — it throwsTypeError: Unsupported type of valueinvalueToProto, before any SQL runs, with no column named and no row to point at. That surfaced as an uncrawlable feed, which reads like a publisher who is down.Why no test caught it: the local SQLite driver every test in this repo uses binds
undefinedas null without complaining. The difference only exists on the wire.Why so many feeds: this is not a platform quirk. Any feed publishing a
<webMaster>ormanagingEditoraddress whose name fails the person test takes this path — WordPress and Substack alike. Verified onlittlealmanack.comandpoliticsnc.comas well as four Substack newsletters.The fixes
source. Worth keeping in its own right: a mailbox fromitunes:owneris a stronger claim than one fromwebMaster, and the column exists to record exactly that.<itunes:owner>on every publication it serves and nothing else that looks like a show — noitunes:type, nopodcast:namespace, image enclosures rather than audio — and that one tag filed the whole platform under/podcasts. This is the correction the video branch already makes: the tag has to be corroborated by what the feed actually ships. A declared show still stands on its own, so a podcast with no episodes yet keeps its category. Categories are re-derived every crawl, so this self-heals.Verification
packages/db/test/link-binds.test.jsasserts what the remote client accepts, not what a local write survives. Confirmed non-vacuous: it fails on the pre-fix code.nemtodamulher.substack.com→kind=blog, contact sourceweb-master; The Daily and Darknet Diaries still →kind=podcast.