feat(dock): route enclosures through the shared engine picker - #155
Merged
Conversation
A post on c0mpute.com would not load in the reader. Nothing was wrong with it: the page answered 200 to every request I made. What had happened is that the reader probed it once, that one request got a 500, and the failure was cached for twenty-four hours — so the post stayed broken long after the origin was fine again. Measured against the live site: one 500 in ninety-nine requests. Not a cold start (the first request after 60, 120 and 180 seconds idle was fine) and not load (forty parallel requests were fine). Just an occasional error, of the kind every origin has. A one-per-cent event was costing a full day of downtime for that post, which is the wrong order of magnitude by about three. The cache itself is right — without it every view of a paywalled post is another request to the publisher — but it had one number for two different situations. A paywall will still be a paywall tomorrow. A 500 is the server telling us it failed, and a network error is us never having heard from it at all; both are worth asking again shortly. So transient failures now retry after ten minutes and everything else keeps the day. The distinction is drawn on the response rather than on any opinion about the site: 5xx and fetch errors are transient, 4xx is an answer, `blocked-host` is a refusal we made ourselves, and `empty` is a paywall or a JavaScript-only page that will parse to nothing at teatime too. Ten minutes is long enough that a genuinely broken origin is not hammered once per viewer, and short enough that nobody files a bug about it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dock set `src={track.src}` on its <video> and its <audio> and hoped. That
is right until an enclosure is something a browser cannot open by itself, and
this directory is a crawl of the open web -- what turns up in an enclosure is
whatever the publisher chose. An HLS playlist handed straight to a <video>
plays nothing and reports a bare media error, which reads as a broken episode
rather than a missing library.
`attachSource` from @profullstack/player names the source and picks how to
deliver it: native for the ordinary MP3 or MP4, hls.js for a playlist.
Nothing else changes. The queue, the position it remembers, the popout,
surviving a soft navigation, the up-next list -- all untouched. This adopts
the package's delivery half only, not its control bar: swapping the bar would
mean deleting a 916-line queue-aware dock to gain a nicer-looking one.
Embeds are skipped, since a YouTube or PeerTube track is an <iframe> with no
media element to attach to. The effect guards a race the attribute could not
have: attaching is asynchronous, because an engine is only downloaded when a
source needs one, so a fast walk through a playlist would otherwise leave an
earlier attachment running under a later one.
EpisodePlayer keeps its static src for now -- it is a server component, so
attaching a client-side engine there is a larger change than this one. Its
comment already notes that no browser recognises HLS's source type, which is
the same gap, on the secondary surface.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WFLwZtXE6iBJyJSgrsWqRM
The branch went conflicting: main moved and pnpm-lock.yaml cannot be merged textually. Two lockfiles merged line by line produce duplicate YAML keys, which pnpm writes happily and then refuses to read -- the same failure that had media-streamer's CI unable to install anything. So the lockfile is taken from main and regenerated rather than resolved by hand, and pnpm-workspace.yaml likewise, which also keeps main's msgpackr-extract decision intact. Pinned at 0.3.1 so all the adopting repos are on one version. next build clean, workspace tests green. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFLwZtXE6iBJyJSgrsWqRM
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Adopts
@profullstack/player— its delivery half only.What changes
The dock's
<video>and<audio>lose theirsrcattribute; an effect attaches the source instead.The dock set
src={track.src}and hoped. That is right until an enclosure is something a browser cannot open by itself — and this directory is a crawl of the open web, so what turns up in an enclosure is whatever the publisher chose. An HLS playlist handed straight to a<video>plays nothing and reports a bare media error, which reads as a broken episode rather than a missing library.attachSourcenames the source and picks the delivery: native for the ordinary MP3 or MP4, hls.js for a playlist.What does not change
The queue, the remembered position, the popout, surviving a soft navigation, the up-next list. This adopts the delivery half only — swapping in the package's control bar would mean deleting a 916-line queue-aware dock to gain a nicer-looking one.
Embeds are skipped: a YouTube or PeerTube track is an
<iframe>with no media element to attach to.Not done, deliberately
EpisodePlayer.jsxkeeps its staticsrc. It is a server component, so attaching a client-side engine there means making it a client one — a bigger change than this. Its own comment already says "no browser recognises HLS's [source type], so a live channel announced that way never starts", which is the same gap on the secondary surface. Worth a follow-up.Checks
next buildclean (18 routes),npm testgreen across the workspace. Note pnpm added@profullstack/player@0.2.0tominimumReleaseAgeExclude— pnpm 11 gates freshly-published packages and this one is minutes old.🤖 Generated with Claude Code
https://claude.ai/code/session_01WFLwZtXE6iBJyJSgrsWqRM