Treat a missing MangaPlus expiry as unknown, not as expired in 1970 - #507
Merged
Merged
Conversation
`chapterExpire` fell back to DEFAULT_TIMESTAMP (epoch second 1) when `endTimeStamp` was absent. proto3 drops zero values, so a chapter that never rotates out of the free window arrives with the field missing -- and stood in as 1, it reads as "expired in 1970". That was already wrong: the filter in `collect` skips anything whose expiry has passed, so such a chapter was silently never uploaded. It becomes dangerous alongside the platform's new paywalled pass, which hard-deletes a chapter the publisher still lists once its expiry is behind us: the chapters that are free forever are exactly the ones it would delete. A missing expiry is now null and stays null through `toChapterInput`, which the chapter contract already allows. The decision moves into `hasExpired` so the rule is one testable line rather than an inline comparison, and null reads as "no expiry stated" everywhere it is asked. Note this does not make expiry a paywall oracle -- `availability.ts` documents the far-future sentinel MangaPlus puts on subscriber-only chapters, which no expiry check can catch. It only stops the absent case from lying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K2GWZ284dc6s3znLsavYrS
ArdaxHz
marked this pull request as ready for review
September 8, 2026 13:59
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
chapterExpirefell back toDEFAULT_TIMESTAMP(epoch second 1) whenendTimeStampwas absent. proto3 drops zero values, so a chapter that never rotates out of the free window arrives with the field missing — and stood in as1, it reads as "expired in 1970".Why it matters
Already wrong today: the filter in
collectskips anything whose expiry has passed, so such a chapter is silently never uploaded.Worse alongside #137, which removes a chapter the publisher still lists once its expiry is behind us — the chapters that are free forever are exactly the ones it would card.
A missing expiry is now
nulland stays null throughtoChapterInput; the chapter contract already allows it (records.ts:.nullable().default(null)). The decision moves intohasExpiredso the rule is one testable line.Not claimed
This does not make expiry a paywall oracle.
availability.tsalready documents the far-future sentinel (2145884400) MangaPlus puts on subscriber-only chapters, which no expiry check can catch. This only stops the absent case from lying.Testing
src/expiry.test.tscovers past, future, exactly-now, and the absent case that motivated it. 62 tests pass; both typecheck configs clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01K2GWZ284dc6s3znLsavYrS