Repository navigation
Parser-correctness sweep, batch 2: a card with an empty Source property is null - #677
Merged
Merged
Conversation
MyAnimeList renders the "Source" property for every card, sometimes with an empty item: "Eigo de Asobo: Tanken Goblin Tou" on the 1990 spring page has <span class="item"></span>. getSource() returned "" there while returning null for a card with no Source property at all, so absence had two shapes. The getter was already ?string; it now returns null for an empty item. Five invariant allowlists named this violation and are removed with the fix, and a corpus test pins the empty-source card and a card that does list one.
This was referenced Nov 11, 2026
The schedule page shares AnimeCardParser, and it carried one of the five allowlist entries this fix deletes. The seasonal test was the only one asserting the new behaviour.
Collaborator
Author
|
Coverage strengthened after an end-to-end pass (commit Full quality green: 1064 tests / 12486 assertions. End-to-end through |
irfan-dahir
changed the base branch from
v5/parser-correctness-sweep
to
master
November 12, 2026 13:14
irfan-dahir
added a commit
that referenced
this pull request
Nov 12, 2026
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.
Batch 2 of the parser-correctness sweep — stacked on #676 so the changelog does not collide; retarget to
masteronce #676 merges.What was wrong
AnimeCardParser::getSource()returned''for a card whose "Source" property is present but empty. MyAnimeList does this for titles it has no source for — the caption and the (empty) item span are both rendered:21 cards on the 1990 spring page and 1 on the current "later" page are like that. A card with no Source property already returned
null, so absence had two shapes; the getter was already?string.Scope check first
I checked whether the positional selector (
div[2]/span[2]) is the real problem before changing it: across the recorded seasonal pages, every card that has properties carries Source as the second property (420/421; the exception has no properties at all). So the selector is not wrong today, and I left it alone rather than making an unprovable change — the defect is only the empty item. That is recorded in the PR so the next person knows the check happened.Verification
master(''is not null) and passes here; it asserts the empty-source card, a card that does list a source, and that no card is left with''.CorpusTest.schedule,CorpusTest.seasonal-1990-spring,CorpusTest.seasonal-later,ScheduleParserTest,SeasonalParserTest) — all of the remaining.sourcedebt."source": ""→null. PR: Snapshot anime cards without a source as null jikan-fixtures#22.composer qualitygreen: 1063 tests / 12476 assertions, PHPStan, php-cs-fixer, endpoint manifest.Remaining sweep debt
Only the 10
paginationviolations are left, and they are a semantics question (lastVisiblePageon lists that don't paginate) — filed separately as an issue rather than patched here.