Repository navigation
ui: season tabs carry their episode count, and a tick once you are through - #1
Merged
Merged
Conversation
…rough
`/library/metadata/{show}/children` returns leafCount/viewedLeafCount on every
season row and `metadata::Season` dropped both on the floor, so a season tab was
its name and nothing else — no size, and no way to tell a season you have
finished from one you have not started.
Both fields now ride `Season`, with the fully-watched rule as `Season::watched()`
rather than a comparison copied to each draw site: it is the season-scope form of
the container rule `fetch_detail` already applies to a show, and the coming "Mark
Season Watched" row will decide which way to scrobble off the same method. Its
`leaf_count > 0` half is the load-bearing part — a season the server sent no
counts for is 0 >= 0, which would otherwise report as fully watched.
On the strip that surfaces as a `TabPill` trailing note (`TabNote`), not as a
second label: one type rung down (CAPTION), never bold, the pill's own ink one
alpha step down, and either the count or the tick — never both competing for the
same slot. The pill sizes itself through `TabPill::note_w`, which `tabs_layout`
also uses, so the strip's x-advance, the scroll-into-view geometry and the pill
width cannot disagree about how wide a tab is. The label then centres in the pill
MINUS the note, so a counted tab keeps label+note centred as one unit instead of
shoving the label off-centre; the note hugs the label's own painted right edge,
which is why none of this needs to know the caller's pill padding.
Verified on the device against The Morning Show (rk=437), whose two seasons are
exactly the interesting pair: season 1 leaves=10 viewed=10 draws the tick,
season 2 leaves=10 viewed=1 draws "10", legible and subordinate in all four pill
states (focused, selected, plain, plain-watched). fps 5/5.
Tests: +1 host (59).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018GuSHrq9oydnX7nhKE1Hvc
Review follow-ups, none of which change a pixel — the device evidence for the previous commit still stands. `Season` loses the `Default` derive it briefly had: the two test fixtures now spell every field again, so the next field added to a season is a compile error at each construction site rather than a silent zero. Counts are exactly the kind of field whose default reads as a legitimate value. `TabPill::draw` records WHY the note anchors on the label's painted width rather than the width the caller measured. A strip that sizes its tabs bold — the season tabs and `draw_tab_row` both do, so an advance cannot move with focus — paints an unbolded label a few px narrower. Pinning the note to the caller's number would hold it still while the label's right edge slid under it: a constant label→note gap traded for a variable one. The gap is the relationship the eye reads. `TabPill::width` says out loud that it covers the label only; a pill that also carries a note must add `note_w`, or the note lands outside the fill. And `tabs_layout` records its per-frame cost honestly: uncached, one CString plus one text measure per season per call, now two with the count. Cheap since `text_width` became a `TTF_SizeUTF8` metrics walk, but a 30-season strip is the shape that would want `ep_meta_h`'s fingerprinted cache — and no FPS scene covers it, because `fps:detail-transition` is a movie and returns before `draw_tabs`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_018GuSHrq9oydnX7nhKE1Hvc
Collaborator
Author
Review pass — what was found, and what I did with itA fresh-eyes correctness sweep over the diff (geometry, lifetimes,
Two things left open, deliberately
|
GLinnik21
added a commit
that referenced
this pull request
Aug 3, 2026
The demuxer chose the default audio with av_find_best_stream, which picks the "highest quality" track — on Home Alone (8 audio tracks, no default disposition) it picked the DTS track (a=#7). But the Load payload carries Media[0].audioCodec (ac3), so the pipeline was told AC3 while fed DTS: the audio ES never configures and, with audioSync, the video slaves to the dead audio clock and wedges (~32s of buffered video, then Feed() BufferFull forever, no window+PLAYING). Now the default audio feeds the first track whose codec MATCHES the payload (audio_stream_matching via avcodec_get_name), falling back to av_find_best_stream only if none matches. Verified on rk 3: feeds a=#1 (ac3), window+PLAYING, timeline climbs 72→142s. Caught by the new regression harness (home_alone_manyaudio). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018QbpQTKYjwp6fDNLdXzGzr
GLinnik21
added a commit
that referenced
this pull request
Aug 23, 2026
… real socket
CI was red on Linux with `thread '<unknown>' has overflowed its stack`,
at a different point in the output each run, while `make check` passed on
the dev Mac. The mechanism is not serde_json and not the session file.
`moving_a_server_to_https_re_points_its_slot` called the public
`register_origin`, where every other test in this module deliberately
goes through `register_with_client_id`. The public path fires
`serverinfo::refresh`, which spawns a `task::spawn_small` worker that
really opens a socket — and in a DEBUG build `stream::http_stream_boxed`
materialises its 64 KiB `HttpStream` as a STACK temporary before it ever
reaches the heap, despite the comment above it promising the opposite
("box it off the caller's stack"). lldb caught it on the guard page:
frame #0 stream::http_stream_boxed
frame #1 stream::http_get(host="10.0.0.1", port=32400, …)
frame #2 Client::get_json
frame #3 Client::server_root
frame #4 serverinfo::fetch_once
frame #5 serverinfo::refresh::{closure#0} <- spawn_small, 256 KiB
Measured on this branch by varying `SMALL_STACK`: debug overflows at 48,
128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is
exactly why one host passed and the other did not. **`--release` passes at
48 KiB**, so the optimizer elides the temporary and the television — which
ships `cargo build --release` (Makefile:438) — is not affected. It is a
latent debug-only hazard in `stream.rs`, pre-existing and not this
branch's to fix; the base simply had no host test that reached
`http_get` from a `spawn_small` worker. Reported on the PR.
The fix is the test, which was wrong on its own terms: `register` also
mints and PERSISTS a client-id uuid, and that seam's doc has said since it
was written that a host test must not write one. It gains an origin-taking
sibling (the pair-shaped one cannot express a scheme, which is what this
test is about) and a second documented reason nobody had paid for yet.
Verified with the same differential that found it: at `SMALL_STACK = 48 *
1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both
`--test-threads=1` and parallel. `task.rs` is untouched.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
GLinnik21
added a commit
that referenced
this pull request
Aug 23, 2026
… and never rebuilt from one (#53) * transport: an Origin is what a server's address IS, and it is parsed from a URL Everything below the transport carried a server's address as a bare `(host, port)` pair. That pair cannot say `https`, and — the half that matters — it cannot be *made* to say it afterwards, because the host a `plex.direct` certificate is issued for is the HOSTNAME plex.tv puts in `Connection.uri`, while `Connection.address` stays the dotted quad behind it. `probe.rs` has said so in prose since it was written ("https to the bare IP fails validation by design"), and `auth::resolve_roster` then threw `Candidate::url` away and wrote `address` into the session file. A later lane adding a `scheme` field on top of that would have produced a control plane that looks like it speaks TLS and fails hostname validation on every real server. So: `plex::Origin` — scheme + host + port, parsed from a URL by `Origin::parse`, never assembled from an address. `Candidate::origin()` is the one derivation; `Candidate::address` is documented down to what it actually is, the diagnostic half. Threaded through every site that passed a bare pair: `Client` (with `host()`/`port()` kept as views, so the ~30 call sites below the layer are untouched), `StreamUrl` and its two construction sites, `register_origin`/`install`, `SourceRef`/`ServerRef`, `ReadyCreds`, `app.rs`'s boot gate and `install_pms`, and the engine's URL splitter. `dev::DevServer` gains an optional `scheme`, which is how an https origin can be exercised headlessly through the `plxnative-servers` trigger by anyone who has no such server to discover. Two invariants are pinned by tests rather than left to prose. `Origin::host()` is ALWAYS unbracketed — it is the `getaddrinfo` node — and `Origin::authority()` ALWAYS brackets a v6 literal, because it is URL serialization; `probe::host_of` returned the bracketed spelling and is gone, replaced by one shared reading of a URL. And a session file written by 0.4.1, carrying `address`/`port` and no origin, must still boot as `http://{address}:{port}`: `Session::server` is not a soft-parsed roster entry, so dropping it is a silent sign-out at every boot for every existing user. Both have a test with a literal 0.4.1-shaped JSON string. NO BEHAVIOUR CHANGE. Every origin is still `http://` and dials the same address: `dial_target` accepts only a plain-http IPv4 candidate, whose URL `probe::candidates` synthesized as `http://{address}:{port}`, so the parsed origin and the old pair are equal today — asserted, not assumed. The registry's two log lines now print `origin.authority()`, which is byte-identical for every http/IPv4 origin and correct for a v6 literal, which `{host}:{port}` could not spell at all. 996 host tests pass. A simulator boot against a real PMS produces an event log identical to the pre-change one on all 30 non-heartbeat lines; the three `loop=`/`fps=` lines vary run to run on an unchanged binary. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: name what the origin model made stale, rather than leaving it to rot `plex/CLAUDE.md` and `servers.rs`/`client.rs`'s module docs described the registry in terms of `(host, port)`, which is the shape the change replaced. `docs/plex-api-design.md` is a design note whose sketches were the implementation of their day — it gets a banner naming the one thing in it that would now mislead (rule 9, "Numeric host, no DNS", and the two struct sketches), not a rewrite. `docs/shared-servers.md` §7 gains the `plxnative-servers` trigger's new `scheme` field, which is the only way to put a TLS origin through the registry without an account that has one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * session: the stored origin field is `origin_url`, so it cannot be mistaken for `origin()` `SourceRef`/`ServerRef` had a FIELD `origin` (the serialized string) beside a METHOD `origin()` (the parsed value). Rust puts those in different namespaces so it compiles either way, which is exactly the problem: two characters separate "the raw JSON string" from "the thing to dial", at every use, forever. The field takes the `_url` suffix; `#[serde(rename)]` keeps the FILE's key spelled `origin`, which is what a human editing a session file on the television reads, and the round-trip test proves the rename applies to both halves of serde. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * review: close the gap between the origin that was DIALLED and the one recorded Eight findings from `/code-review high`; six fixed, two answered in prose. **The one that mattered.** `resolve_roster` recorded `Candidate::origin()` while `probe_server` dialled `(&c.address, dial_port(c.port))`, and the comment justifying that divergence was wrong about its own gate: `dial_target` checks `is_ipv4_literal(&c.address)`, which admits a plex.tv-advertised `uri` candidate and not only the synthesized twin. A connection whose `uri` names a different port from `port` would be verified at one and written into the session file as the other, and every later request would go somewhere nothing ever answered from. So `dial_target` now returns the ORIGIN, `probe_server` dials that origin's host and port, and `Reach::At` carries it back beside the candidate — one value, so what answered and what is recorded cannot be two addresses. The candidate stays for the diagnostic fields. Its fixture had `url` and `port` disagreeing, which is what let the old shape look consistent; it builds both from one pair now, as `probe::candidates` does. **The silent-instrument trap, twice.** `dev::DevServer`'s `scheme` field exists so a lane with no TLS server of its own can put an https origin through the registry — and both registry log lines and `DevServer:: describe` printed `host:port`, so such a run was byte-identical to an http one. `Origin::log_form()` is the shared answer: the bare authority for a plaintext origin (an archived log stays comparable, and the byte-identical gate holds) and the whole URL as soon as the scheme is worth saying. **`player::engine` REFUSES a TLS stream target** instead of silently downgrading it, which is what the code did while its comment claimed the opposite. It is reachable today: a client registered at an https origin copies that origin into `direct_play_url`/`transcode_start_url`, so `route` would store an https URL and the engine would open a plaintext socket to it. Also: an EMPTY port (`http://h:`) is a port that was WRITTEN and cannot be dialled, so `Origin::parse` refuses it rather than defaulting to 32400 — a truncated write of the session file is exactly the "port nobody wrote down" case `dial_port` exists for. And `reconcile_primary` no longer logs "primary now answers at …" when the only thing that changed was the stored origin going from empty to populated, which is what the FIRST BOOT after this lands does on every existing install — a false DHCP-churn report in the file this project treats as its primary evidence surface. Answered rather than changed: `Origin::port`'s doc claimed a narrowing one constructor does not perform (`ServerRef::origin`'s legacy `port as i32`), so the doc now says where the narrowing really lives; and `Session::can_go_local` still asks "is there an address written down" rather than "can THIS build's transport open it" — gating it would send a user to a QR code for a transport gap that is not theirs, and the half-landed state it exposes is named in the doc and refused out loud one layer down, in the engine. 997 host tests pass. The simulator event log is still identical to the pre-change one on all 30 non-heartbeat lines. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: a registry test must not call the PUBLIC register — it opens a real socket CI was red on Linux with `thread '<unknown>' has overflowed its stack`, at a different point in the output each run, while `make check` passed on the dev Mac. The mechanism is not serde_json and not the session file. `moving_a_server_to_https_re_points_its_slot` called the public `register_origin`, where every other test in this module deliberately goes through `register_with_client_id`. The public path fires `serverinfo::refresh`, which spawns a `task::spawn_small` worker that really opens a socket — and in a DEBUG build `stream::http_stream_boxed` materialises its 64 KiB `HttpStream` as a STACK temporary before it ever reaches the heap, despite the comment above it promising the opposite ("box it off the caller's stack"). lldb caught it on the guard page: frame #0 stream::http_stream_boxed frame #1 stream::http_get(host="10.0.0.1", port=32400, …) frame #2 Client::get_json frame #3 Client::server_root frame #4 serverinfo::fetch_once frame #5 serverinfo::refresh::{closure#0} <- spawn_small, 256 KiB Measured on this branch by varying `SMALL_STACK`: debug overflows at 48, 128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is exactly why one host passed and the other did not. **`--release` passes at 48 KiB**, so the optimizer elides the temporary and the television — which ships `cargo build --release` (Makefile:438) — is not affected. It is a latent debug-only hazard in `stream.rs`, pre-existing and not this branch's to fix; the base simply had no host test that reached `http_get` from a `spawn_small` worker. Reported on the PR. The fix is the test, which was wrong on its own terms: `register` also mints and PERSISTS a client-id uuid, and that seam's doc has said since it was written that a host test must not write one. It gains an origin-taking sibling (the pair-shaped one cannot express a scheme, which is what this test is about) and a second documented reason nobody had paid for yet. Verified with the same differential that found it: at `SMALL_STACK = 48 * 1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both `--test-threads=1` and parallel. `task.rs` is untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 26, 2026
The demuxer chose the default audio with av_find_best_stream, which picks the "highest quality" track — on Home Alone (8 audio tracks, no default disposition) it picked the DTS track (a=#7). But the Load payload carries Media[0].audioCodec (ac3), so the pipeline was told AC3 while fed DTS: the audio ES never configures and, with audioSync, the video slaves to the dead audio clock and wedges (~32s of buffered video, then Feed() BufferFull forever, no window+PLAYING). Now the default audio feeds the first track whose codec MATCHES the payload (audio_stream_matching via avcodec_get_name), falling back to av_find_best_stream only if none matches. Verified on rk 3: feeds a=#1 (ac3), window+PLAYING, timeline climbs 72→142s. Caught by the new regression harness (home_alone_manyaudio). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018QbpQTKYjwp6fDNLdXzGzr
GLinnik21
added a commit
that referenced
this pull request
Aug 26, 2026
… and never rebuilt from one (#53) * transport: an Origin is what a server's address IS, and it is parsed from a URL Everything below the transport carried a server's address as a bare `(host, port)` pair. That pair cannot say `https`, and — the half that matters — it cannot be *made* to say it afterwards, because the host a `plex.direct` certificate is issued for is the HOSTNAME plex.tv puts in `Connection.uri`, while `Connection.address` stays the dotted quad behind it. `probe.rs` has said so in prose since it was written ("https to the bare IP fails validation by design"), and `auth::resolve_roster` then threw `Candidate::url` away and wrote `address` into the session file. A later lane adding a `scheme` field on top of that would have produced a control plane that looks like it speaks TLS and fails hostname validation on every real server. So: `plex::Origin` — scheme + host + port, parsed from a URL by `Origin::parse`, never assembled from an address. `Candidate::origin()` is the one derivation; `Candidate::address` is documented down to what it actually is, the diagnostic half. Threaded through every site that passed a bare pair: `Client` (with `host()`/`port()` kept as views, so the ~30 call sites below the layer are untouched), `StreamUrl` and its two construction sites, `register_origin`/`install`, `SourceRef`/`ServerRef`, `ReadyCreds`, `app.rs`'s boot gate and `install_pms`, and the engine's URL splitter. `dev::DevServer` gains an optional `scheme`, which is how an https origin can be exercised headlessly through the `plxnative-servers` trigger by anyone who has no such server to discover. Two invariants are pinned by tests rather than left to prose. `Origin::host()` is ALWAYS unbracketed — it is the `getaddrinfo` node — and `Origin::authority()` ALWAYS brackets a v6 literal, because it is URL serialization; `probe::host_of` returned the bracketed spelling and is gone, replaced by one shared reading of a URL. And a session file written by 0.4.1, carrying `address`/`port` and no origin, must still boot as `http://{address}:{port}`: `Session::server` is not a soft-parsed roster entry, so dropping it is a silent sign-out at every boot for every existing user. Both have a test with a literal 0.4.1-shaped JSON string. NO BEHAVIOUR CHANGE. Every origin is still `http://` and dials the same address: `dial_target` accepts only a plain-http IPv4 candidate, whose URL `probe::candidates` synthesized as `http://{address}:{port}`, so the parsed origin and the old pair are equal today — asserted, not assumed. The registry's two log lines now print `origin.authority()`, which is byte-identical for every http/IPv4 origin and correct for a v6 literal, which `{host}:{port}` could not spell at all. 996 host tests pass. A simulator boot against a real PMS produces an event log identical to the pre-change one on all 30 non-heartbeat lines; the three `loop=`/`fps=` lines vary run to run on an unchanged binary. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: name what the origin model made stale, rather than leaving it to rot `plex/CLAUDE.md` and `servers.rs`/`client.rs`'s module docs described the registry in terms of `(host, port)`, which is the shape the change replaced. `docs/plex-api-design.md` is a design note whose sketches were the implementation of their day — it gets a banner naming the one thing in it that would now mislead (rule 9, "Numeric host, no DNS", and the two struct sketches), not a rewrite. `docs/shared-servers.md` §7 gains the `plxnative-servers` trigger's new `scheme` field, which is the only way to put a TLS origin through the registry without an account that has one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * session: the stored origin field is `origin_url`, so it cannot be mistaken for `origin()` `SourceRef`/`ServerRef` had a FIELD `origin` (the serialized string) beside a METHOD `origin()` (the parsed value). Rust puts those in different namespaces so it compiles either way, which is exactly the problem: two characters separate "the raw JSON string" from "the thing to dial", at every use, forever. The field takes the `_url` suffix; `#[serde(rename)]` keeps the FILE's key spelled `origin`, which is what a human editing a session file on the television reads, and the round-trip test proves the rename applies to both halves of serde. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * review: close the gap between the origin that was DIALLED and the one recorded Eight findings from `/code-review high`; six fixed, two answered in prose. **The one that mattered.** `resolve_roster` recorded `Candidate::origin()` while `probe_server` dialled `(&c.address, dial_port(c.port))`, and the comment justifying that divergence was wrong about its own gate: `dial_target` checks `is_ipv4_literal(&c.address)`, which admits a plex.tv-advertised `uri` candidate and not only the synthesized twin. A connection whose `uri` names a different port from `port` would be verified at one and written into the session file as the other, and every later request would go somewhere nothing ever answered from. So `dial_target` now returns the ORIGIN, `probe_server` dials that origin's host and port, and `Reach::At` carries it back beside the candidate — one value, so what answered and what is recorded cannot be two addresses. The candidate stays for the diagnostic fields. Its fixture had `url` and `port` disagreeing, which is what let the old shape look consistent; it builds both from one pair now, as `probe::candidates` does. **The silent-instrument trap, twice.** `dev::DevServer`'s `scheme` field exists so a lane with no TLS server of its own can put an https origin through the registry — and both registry log lines and `DevServer:: describe` printed `host:port`, so such a run was byte-identical to an http one. `Origin::log_form()` is the shared answer: the bare authority for a plaintext origin (an archived log stays comparable, and the byte-identical gate holds) and the whole URL as soon as the scheme is worth saying. **`player::engine` REFUSES a TLS stream target** instead of silently downgrading it, which is what the code did while its comment claimed the opposite. It is reachable today: a client registered at an https origin copies that origin into `direct_play_url`/`transcode_start_url`, so `route` would store an https URL and the engine would open a plaintext socket to it. Also: an EMPTY port (`http://h:`) is a port that was WRITTEN and cannot be dialled, so `Origin::parse` refuses it rather than defaulting to 32400 — a truncated write of the session file is exactly the "port nobody wrote down" case `dial_port` exists for. And `reconcile_primary` no longer logs "primary now answers at …" when the only thing that changed was the stored origin going from empty to populated, which is what the FIRST BOOT after this lands does on every existing install — a false DHCP-churn report in the file this project treats as its primary evidence surface. Answered rather than changed: `Origin::port`'s doc claimed a narrowing one constructor does not perform (`ServerRef::origin`'s legacy `port as i32`), so the doc now says where the narrowing really lives; and `Session::can_go_local` still asks "is there an address written down" rather than "can THIS build's transport open it" — gating it would send a user to a QR code for a transport gap that is not theirs, and the half-landed state it exposes is named in the doc and refused out loud one layer down, in the engine. 997 host tests pass. The simulator event log is still identical to the pre-change one on all 30 non-heartbeat lines. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: a registry test must not call the PUBLIC register — it opens a real socket CI was red on Linux with `thread '<unknown>' has overflowed its stack`, at a different point in the output each run, while `make check` passed on the dev Mac. The mechanism is not serde_json and not the session file. `moving_a_server_to_https_re_points_its_slot` called the public `register_origin`, where every other test in this module deliberately goes through `register_with_client_id`. The public path fires `serverinfo::refresh`, which spawns a `task::spawn_small` worker that really opens a socket — and in a DEBUG build `stream::http_stream_boxed` materialises its 64 KiB `HttpStream` as a STACK temporary before it ever reaches the heap, despite the comment above it promising the opposite ("box it off the caller's stack"). lldb caught it on the guard page: frame #0 stream::http_stream_boxed frame #1 stream::http_get(host="10.0.0.1", port=32400, …) frame #2 Client::get_json frame #3 Client::server_root frame #4 serverinfo::fetch_once frame #5 serverinfo::refresh::{closure#0} <- spawn_small, 256 KiB Measured on this branch by varying `SMALL_STACK`: debug overflows at 48, 128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is exactly why one host passed and the other did not. **`--release` passes at 48 KiB**, so the optimizer elides the temporary and the television — which ships `cargo build --release` (Makefile:438) — is not affected. It is a latent debug-only hazard in `stream.rs`, pre-existing and not this branch's to fix; the base simply had no host test that reached `http_get` from a `spawn_small` worker. Reported on the PR. The fix is the test, which was wrong on its own terms: `register` also mints and PERSISTS a client-id uuid, and that seam's doc has said since it was written that a host test must not write one. It gains an origin-taking sibling (the pair-shaped one cannot express a scheme, which is what this test is about) and a second documented reason nobody had paid for yet. Verified with the same differential that found it: at `SMALL_STACK = 48 * 1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both `--test-threads=1` and parallel. `task.rs` is untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 27, 2026
… and never rebuilt from one (#53) * transport: an Origin is what a server's address IS, and it is parsed from a URL Everything below the transport carried a server's address as a bare `(host, port)` pair. That pair cannot say `https`, and — the half that matters — it cannot be *made* to say it afterwards, because the host a `plex.direct` certificate is issued for is the HOSTNAME plex.tv puts in `Connection.uri`, while `Connection.address` stays the dotted quad behind it. `probe.rs` has said so in prose since it was written ("https to the bare IP fails validation by design"), and `auth::resolve_roster` then threw `Candidate::url` away and wrote `address` into the session file. A later lane adding a `scheme` field on top of that would have produced a control plane that looks like it speaks TLS and fails hostname validation on every real server. So: `plex::Origin` — scheme + host + port, parsed from a URL by `Origin::parse`, never assembled from an address. `Candidate::origin()` is the one derivation; `Candidate::address` is documented down to what it actually is, the diagnostic half. Threaded through every site that passed a bare pair: `Client` (with `host()`/`port()` kept as views, so the ~30 call sites below the layer are untouched), `StreamUrl` and its two construction sites, `register_origin`/`install`, `SourceRef`/`ServerRef`, `ReadyCreds`, `app.rs`'s boot gate and `install_pms`, and the engine's URL splitter. `dev::DevServer` gains an optional `scheme`, which is how an https origin can be exercised headlessly through the `plxnative-servers` trigger by anyone who has no such server to discover. Two invariants are pinned by tests rather than left to prose. `Origin::host()` is ALWAYS unbracketed — it is the `getaddrinfo` node — and `Origin::authority()` ALWAYS brackets a v6 literal, because it is URL serialization; `probe::host_of` returned the bracketed spelling and is gone, replaced by one shared reading of a URL. And a session file written by 0.4.1, carrying `address`/`port` and no origin, must still boot as `http://{address}:{port}`: `Session::server` is not a soft-parsed roster entry, so dropping it is a silent sign-out at every boot for every existing user. Both have a test with a literal 0.4.1-shaped JSON string. NO BEHAVIOUR CHANGE. Every origin is still `http://` and dials the same address: `dial_target` accepts only a plain-http IPv4 candidate, whose URL `probe::candidates` synthesized as `http://{address}:{port}`, so the parsed origin and the old pair are equal today — asserted, not assumed. The registry's two log lines now print `origin.authority()`, which is byte-identical for every http/IPv4 origin and correct for a v6 literal, which `{host}:{port}` could not spell at all. 996 host tests pass. A simulator boot against a real PMS produces an event log identical to the pre-change one on all 30 non-heartbeat lines; the three `loop=`/`fps=` lines vary run to run on an unchanged binary. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: name what the origin model made stale, rather than leaving it to rot `plex/CLAUDE.md` and `servers.rs`/`client.rs`'s module docs described the registry in terms of `(host, port)`, which is the shape the change replaced. `docs/plex-api-design.md` is a design note whose sketches were the implementation of their day — it gets a banner naming the one thing in it that would now mislead (rule 9, "Numeric host, no DNS", and the two struct sketches), not a rewrite. `docs/shared-servers.md` §7 gains the `plxnative-servers` trigger's new `scheme` field, which is the only way to put a TLS origin through the registry without an account that has one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * session: the stored origin field is `origin_url`, so it cannot be mistaken for `origin()` `SourceRef`/`ServerRef` had a FIELD `origin` (the serialized string) beside a METHOD `origin()` (the parsed value). Rust puts those in different namespaces so it compiles either way, which is exactly the problem: two characters separate "the raw JSON string" from "the thing to dial", at every use, forever. The field takes the `_url` suffix; `#[serde(rename)]` keeps the FILE's key spelled `origin`, which is what a human editing a session file on the television reads, and the round-trip test proves the rename applies to both halves of serde. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * review: close the gap between the origin that was DIALLED and the one recorded Eight findings from `/code-review high`; six fixed, two answered in prose. **The one that mattered.** `resolve_roster` recorded `Candidate::origin()` while `probe_server` dialled `(&c.address, dial_port(c.port))`, and the comment justifying that divergence was wrong about its own gate: `dial_target` checks `is_ipv4_literal(&c.address)`, which admits a plex.tv-advertised `uri` candidate and not only the synthesized twin. A connection whose `uri` names a different port from `port` would be verified at one and written into the session file as the other, and every later request would go somewhere nothing ever answered from. So `dial_target` now returns the ORIGIN, `probe_server` dials that origin's host and port, and `Reach::At` carries it back beside the candidate — one value, so what answered and what is recorded cannot be two addresses. The candidate stays for the diagnostic fields. Its fixture had `url` and `port` disagreeing, which is what let the old shape look consistent; it builds both from one pair now, as `probe::candidates` does. **The silent-instrument trap, twice.** `dev::DevServer`'s `scheme` field exists so a lane with no TLS server of its own can put an https origin through the registry — and both registry log lines and `DevServer:: describe` printed `host:port`, so such a run was byte-identical to an http one. `Origin::log_form()` is the shared answer: the bare authority for a plaintext origin (an archived log stays comparable, and the byte-identical gate holds) and the whole URL as soon as the scheme is worth saying. **`player::engine` REFUSES a TLS stream target** instead of silently downgrading it, which is what the code did while its comment claimed the opposite. It is reachable today: a client registered at an https origin copies that origin into `direct_play_url`/`transcode_start_url`, so `route` would store an https URL and the engine would open a plaintext socket to it. Also: an EMPTY port (`http://h:`) is a port that was WRITTEN and cannot be dialled, so `Origin::parse` refuses it rather than defaulting to 32400 — a truncated write of the session file is exactly the "port nobody wrote down" case `dial_port` exists for. And `reconcile_primary` no longer logs "primary now answers at …" when the only thing that changed was the stored origin going from empty to populated, which is what the FIRST BOOT after this lands does on every existing install — a false DHCP-churn report in the file this project treats as its primary evidence surface. Answered rather than changed: `Origin::port`'s doc claimed a narrowing one constructor does not perform (`ServerRef::origin`'s legacy `port as i32`), so the doc now says where the narrowing really lives; and `Session::can_go_local` still asks "is there an address written down" rather than "can THIS build's transport open it" — gating it would send a user to a QR code for a transport gap that is not theirs, and the half-landed state it exposes is named in the doc and refused out loud one layer down, in the engine. 997 host tests pass. The simulator event log is still identical to the pre-change one on all 30 non-heartbeat lines. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: a registry test must not call the PUBLIC register — it opens a real socket CI was red on Linux with `thread '<unknown>' has overflowed its stack`, at a different point in the output each run, while `make check` passed on the dev Mac. The mechanism is not serde_json and not the session file. `moving_a_server_to_https_re_points_its_slot` called the public `register_origin`, where every other test in this module deliberately goes through `register_with_client_id`. The public path fires `serverinfo::refresh`, which spawns a `task::spawn_small` worker that really opens a socket — and in a DEBUG build `stream::http_stream_boxed` materialises its 64 KiB `HttpStream` as a STACK temporary before it ever reaches the heap, despite the comment above it promising the opposite ("box it off the caller's stack"). lldb caught it on the guard page: frame #0 stream::http_stream_boxed frame #1 stream::http_get(host="10.0.0.1", port=32400, …) frame #2 Client::get_json frame #3 Client::server_root frame #4 serverinfo::fetch_once frame #5 serverinfo::refresh::{closure#0} <- spawn_small, 256 KiB Measured on this branch by varying `SMALL_STACK`: debug overflows at 48, 128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is exactly why one host passed and the other did not. **`--release` passes at 48 KiB**, so the optimizer elides the temporary and the television — which ships `cargo build --release` (Makefile:438) — is not affected. It is a latent debug-only hazard in `stream.rs`, pre-existing and not this branch's to fix; the base simply had no host test that reached `http_get` from a `spawn_small` worker. Reported on the PR. The fix is the test, which was wrong on its own terms: `register` also mints and PERSISTS a client-id uuid, and that seam's doc has said since it was written that a host test must not write one. It gains an origin-taking sibling (the pair-shaped one cannot express a scheme, which is what this test is about) and a second documented reason nobody had paid for yet. Verified with the same differential that found it: at `SMALL_STACK = 48 * 1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both `--test-threads=1` and parallel. `task.rs` is untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 28, 2026
… and never rebuilt from one (#53) * transport: an Origin is what a server's address IS, and it is parsed from a URL Everything below the transport carried a server's address as a bare `(host, port)` pair. That pair cannot say `https`, and — the half that matters — it cannot be *made* to say it afterwards, because the host a `plex.direct` certificate is issued for is the HOSTNAME plex.tv puts in `Connection.uri`, while `Connection.address` stays the dotted quad behind it. `probe.rs` has said so in prose since it was written ("https to the bare IP fails validation by design"), and `auth::resolve_roster` then threw `Candidate::url` away and wrote `address` into the session file. A later lane adding a `scheme` field on top of that would have produced a control plane that looks like it speaks TLS and fails hostname validation on every real server. So: `plex::Origin` — scheme + host + port, parsed from a URL by `Origin::parse`, never assembled from an address. `Candidate::origin()` is the one derivation; `Candidate::address` is documented down to what it actually is, the diagnostic half. Threaded through every site that passed a bare pair: `Client` (with `host()`/`port()` kept as views, so the ~30 call sites below the layer are untouched), `StreamUrl` and its two construction sites, `register_origin`/`install`, `SourceRef`/`ServerRef`, `ReadyCreds`, `app.rs`'s boot gate and `install_pms`, and the engine's URL splitter. `dev::DevServer` gains an optional `scheme`, which is how an https origin can be exercised headlessly through the `plxnative-servers` trigger by anyone who has no such server to discover. Two invariants are pinned by tests rather than left to prose. `Origin::host()` is ALWAYS unbracketed — it is the `getaddrinfo` node — and `Origin::authority()` ALWAYS brackets a v6 literal, because it is URL serialization; `probe::host_of` returned the bracketed spelling and is gone, replaced by one shared reading of a URL. And a session file written by 0.4.1, carrying `address`/`port` and no origin, must still boot as `http://{address}:{port}`: `Session::server` is not a soft-parsed roster entry, so dropping it is a silent sign-out at every boot for every existing user. Both have a test with a literal 0.4.1-shaped JSON string. NO BEHAVIOUR CHANGE. Every origin is still `http://` and dials the same address: `dial_target` accepts only a plain-http IPv4 candidate, whose URL `probe::candidates` synthesized as `http://{address}:{port}`, so the parsed origin and the old pair are equal today — asserted, not assumed. The registry's two log lines now print `origin.authority()`, which is byte-identical for every http/IPv4 origin and correct for a v6 literal, which `{host}:{port}` could not spell at all. 996 host tests pass. A simulator boot against a real PMS produces an event log identical to the pre-change one on all 30 non-heartbeat lines; the three `loop=`/`fps=` lines vary run to run on an unchanged binary. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: name what the origin model made stale, rather than leaving it to rot `plex/CLAUDE.md` and `servers.rs`/`client.rs`'s module docs described the registry in terms of `(host, port)`, which is the shape the change replaced. `docs/plex-api-design.md` is a design note whose sketches were the implementation of their day — it gets a banner naming the one thing in it that would now mislead (rule 9, "Numeric host, no DNS", and the two struct sketches), not a rewrite. `docs/shared-servers.md` §7 gains the `plxnative-servers` trigger's new `scheme` field, which is the only way to put a TLS origin through the registry without an account that has one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * session: the stored origin field is `origin_url`, so it cannot be mistaken for `origin()` `SourceRef`/`ServerRef` had a FIELD `origin` (the serialized string) beside a METHOD `origin()` (the parsed value). Rust puts those in different namespaces so it compiles either way, which is exactly the problem: two characters separate "the raw JSON string" from "the thing to dial", at every use, forever. The field takes the `_url` suffix; `#[serde(rename)]` keeps the FILE's key spelled `origin`, which is what a human editing a session file on the television reads, and the round-trip test proves the rename applies to both halves of serde. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * review: close the gap between the origin that was DIALLED and the one recorded Eight findings from `/code-review high`; six fixed, two answered in prose. **The one that mattered.** `resolve_roster` recorded `Candidate::origin()` while `probe_server` dialled `(&c.address, dial_port(c.port))`, and the comment justifying that divergence was wrong about its own gate: `dial_target` checks `is_ipv4_literal(&c.address)`, which admits a plex.tv-advertised `uri` candidate and not only the synthesized twin. A connection whose `uri` names a different port from `port` would be verified at one and written into the session file as the other, and every later request would go somewhere nothing ever answered from. So `dial_target` now returns the ORIGIN, `probe_server` dials that origin's host and port, and `Reach::At` carries it back beside the candidate — one value, so what answered and what is recorded cannot be two addresses. The candidate stays for the diagnostic fields. Its fixture had `url` and `port` disagreeing, which is what let the old shape look consistent; it builds both from one pair now, as `probe::candidates` does. **The silent-instrument trap, twice.** `dev::DevServer`'s `scheme` field exists so a lane with no TLS server of its own can put an https origin through the registry — and both registry log lines and `DevServer:: describe` printed `host:port`, so such a run was byte-identical to an http one. `Origin::log_form()` is the shared answer: the bare authority for a plaintext origin (an archived log stays comparable, and the byte-identical gate holds) and the whole URL as soon as the scheme is worth saying. **`player::engine` REFUSES a TLS stream target** instead of silently downgrading it, which is what the code did while its comment claimed the opposite. It is reachable today: a client registered at an https origin copies that origin into `direct_play_url`/`transcode_start_url`, so `route` would store an https URL and the engine would open a plaintext socket to it. Also: an EMPTY port (`http://h:`) is a port that was WRITTEN and cannot be dialled, so `Origin::parse` refuses it rather than defaulting to 32400 — a truncated write of the session file is exactly the "port nobody wrote down" case `dial_port` exists for. And `reconcile_primary` no longer logs "primary now answers at …" when the only thing that changed was the stored origin going from empty to populated, which is what the FIRST BOOT after this lands does on every existing install — a false DHCP-churn report in the file this project treats as its primary evidence surface. Answered rather than changed: `Origin::port`'s doc claimed a narrowing one constructor does not perform (`ServerRef::origin`'s legacy `port as i32`), so the doc now says where the narrowing really lives; and `Session::can_go_local` still asks "is there an address written down" rather than "can THIS build's transport open it" — gating it would send a user to a QR code for a transport gap that is not theirs, and the half-landed state it exposes is named in the doc and refused out loud one layer down, in the engine. 997 host tests pass. The simulator event log is still identical to the pre-change one on all 30 non-heartbeat lines. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: a registry test must not call the PUBLIC register — it opens a real socket CI was red on Linux with `thread '<unknown>' has overflowed its stack`, at a different point in the output each run, while `make check` passed on the dev Mac. The mechanism is not serde_json and not the session file. `moving_a_server_to_https_re_points_its_slot` called the public `register_origin`, where every other test in this module deliberately goes through `register_with_client_id`. The public path fires `serverinfo::refresh`, which spawns a `task::spawn_small` worker that really opens a socket — and in a DEBUG build `stream::http_stream_boxed` materialises its 64 KiB `HttpStream` as a STACK temporary before it ever reaches the heap, despite the comment above it promising the opposite ("box it off the caller's stack"). lldb caught it on the guard page: frame #0 stream::http_stream_boxed frame #1 stream::http_get(host="10.0.0.1", port=32400, …) frame #2 Client::get_json frame #3 Client::server_root frame #4 serverinfo::fetch_once frame #5 serverinfo::refresh::{closure#0} <- spawn_small, 256 KiB Measured on this branch by varying `SMALL_STACK`: debug overflows at 48, 128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is exactly why one host passed and the other did not. **`--release` passes at 48 KiB**, so the optimizer elides the temporary and the television — which ships `cargo build --release` (Makefile:438) — is not affected. It is a latent debug-only hazard in `stream.rs`, pre-existing and not this branch's to fix; the base simply had no host test that reached `http_get` from a `spawn_small` worker. Reported on the PR. The fix is the test, which was wrong on its own terms: `register` also mints and PERSISTS a client-id uuid, and that seam's doc has said since it was written that a host test must not write one. It gains an origin-taking sibling (the pair-shaped one cannot express a scheme, which is what this test is about) and a second documented reason nobody had paid for yet. Verified with the same differential that found it: at `SMALL_STACK = 48 * 1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both `--test-threads=1` and parallel. `task.rs` is untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
1 task done
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.
Parity unit 3 (
docs/parity-gaps.md§2 theme A / §5c): the season tabs now say how big a season is and whether you have finished it.What changed
metadata::Seasongainsleaf_count/viewed_leaf_count— already parsed atplex/models.rs:150-153, previously never copied across — plusSeason::watched(), the season-scope form of the container rulefetch_detailapplies to a show (viewed >= leaf && leaf > 0). It lives on the data so the tab's tick and the coming Mark Season Watched row read one truth. Theleaf_count > 0half is load-bearing: a season with no counts is0 >= 0, which would otherwise report as fully watched.ui/widgets.rs:TabPillgains a trailingTabNote— a count, or a tick — one type rung down (size::CAPTION), never bold, the pill's own ink one alpha step down. It is an annotation, not a second label.TabPill::note_wis the single width source, so pill width, the strip's x-advance and the scroll-into-view geometry cannot disagree.ui/detail.rs:tabs_layoutreturns aTabLay(was a 4-tuple) carrying the note; the label centres in the pill minus the note so a counted tab keeps label+note centred as one unit.No new colour literal, no raw font size, no hand-placed text; the note is drawn through
Label/icons::draw(which snaps its own origin).Verification
make check— 59/59 (baseline 58, +1: the fully-watched rule, including the no-counts and over-count edges).make— ARM cross-build green../tests/run.py --fps5/5 (no playback cases — this is UI-only), then aDISPLAYcapture of The Morning Show (rk=437).Server truth vs. what rendered, from
/library/metadata/437/children:10Captured in all four pill states (focused, selected-unfocused, plain, plain-watched): the count is clearly legible and clearly subordinate to the label, and the pill padding stays even on both sides.
🤖 Generated with Claude Code
https://claude.ai/code/session_018GuSHrq9oydnX7nhKE1Hvc