Repository navigation
Parser-correctness sweep, batch 1: streaming attribution link, empty background, search synopsis - #676
Conversation
The streaming block ends with a "Streaming platforms provided by JustWatch" link. It is not a platform and carries no name, so it came out of getStreamingLinks() as an extra Url with name "" and a justwatch.com URL, on every page that lists platforms. Also return null from getBackground() when the section exists but holds no text; it returned "" there while returning null for a title with no section at all, so absence had two shapes. Both were the only entries in the model-invariant allowlists that named this model; the six allowlist files are removed with the fix and a corpus test pins the behaviour on the recorded anime-1 and anime-5114 pages.
|
CI note for whoever picks this up: the test jobs here fail on exactly the six snapshots this change regenerates, because
|
A title with no synopsis still gets the div, empty: "Unmei" on the Fate search page carries <div class="pt4"></div>. getSynopsis() cleansed that to "", so search results reported absence as an empty string while every other absent field in the library is null. The getter is now ?string on AnimeSearchListItem and MangaSearchListItem and returns null for an empty block. Eleven invariant allowlists named this violation; they are removed with the fix, and a corpus test pins the Unmei case on the recorded Fate page.
anime/5114 has no #broadcast-block; its platforms hang off div.broadcast anchors, so the filter is now pinned against that second shape too. And anime/1 asserts a background that exists survives the new null path, which until now only had its null branch tested.
|
Coverage strengthened after an end-to-end pass (commit
End-to-end through |
Batch 1 of the parser-correctness sweep. Every defect here was found by the repo's own honesty checks —
scripts/field_witness.phpand the model-invariant allowlists — and each shrinks an allowlist to nothing.1. An unnamed 12th streaming "platform"
getStreamingLinks()selected every<a>in the streaming block, including MyAnimeList's "Streaming platforms provided by JustWatch" attribution link — not a platform, no name,justwatch.comURL. Onanime/1the model had 12 links for 11 platforms, the lastname: "".2.
backgroundhad two shapes for absencenullwhen the section was missing,""when it was present but held no text. It is?stringfor exactly that reason.3. A search result with no synopsis returned
""instead ofnullA title with no synopsis still gets the block, empty (
<div class="pt4"></div>; "Unmei" on the Fate search page).getSynopsis()cleansed that to'', so search results were the last fields reporting absence as an empty string while the rest of the library returnsnull(DECISIONS.md, "Missing and unreadable data").This is the only consumer-visible signature change in the batch:
AnimeSearchListItem::getSynopsis()andMangaSearchListItem::getSynopsis()are now?string. Changelog entry under Changed;UPGRADING.mdis v4→v5-only, so nothing to add there.Verification
masterand pass here (for the synopsis: 0 results withnullbefore, exactly 1 — "Unmei" — after)."synopsis": ""→null; the streaming/background diff is 5 unnamedUrlremovals and 3""→null.composer qualitygreen: 1062 tests / 12386 assertions, PHPStan, php-cs-fixer, endpoint manifest.Merge order
jikan-me/jikan-fixtures#21 first, then this — CI clones fixtures
master, so the test jobs here are red on exactly the 17 regenerated snapshots until it lands (comment above has the detail). Unrelated: #675 is untouched and still awaiting review.