fix(ingest): retire a day-precision row on the clock the app reads it on
Three parsers decide currency against ctx.now, because their page has no "ongoing" heading worth trusting: bawiki.ts, and the Fate/Grand Order and Infinity Nikki branches of fandom.ts. All three compared Date.parse(endsAt) to now, and all three publish day-precision ends — so the comparison was against the 00:00Z placeholder, which § Domain rules says is not an instant and nothing may read literally. clockFor already knows that and resolves such a boundary to the reset opening that game-day on the reader's server. The parsers did not, so the feed retired a row up to nine hours before the app, the countdown and the game all agreed it was over. On the pinned Infinity Nikki fixture, "Inspiration Burst" left the feed at 2026-08-22T01:00Z while clockFor still called it live for an American reader until 09:00Z, and the page said it ran to 03:59 server time. The reader does not see a stale row; they see the deadline they were counting down to disappear on its last day, which is the silent drop this codebase treats as the dangerous failure. latestBoundaryMs answers clockFor's question for the last region rather than one reader's, so a row is history only once it is history everywhere. It follows a game's own server map and reset hour for the same reason clockFor does — Endfield and Reverse: 1999 both move. Nothing stored changes: this is one comparison, not a resolved boundary written into the feed, and no expected.json moves. Being generous by nine hours costs an expired row at the bottom of a list. Being strict costs a live one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0f9c141ea5
commit
c782a265ca
@@ -1,4 +1,5 @@
|
||||
import { eventId, type GachaEvent } from "../../shared/schema.ts";
|
||||
import { latestBoundaryMs } from "../../shared/time.ts";
|
||||
import {
|
||||
parseDayMonthYearClock,
|
||||
parseFullRange,
|
||||
@@ -229,7 +230,14 @@ function parseFgoOngoingEvents(
|
||||
|
||||
// "Ongoing" is maintained by hand and goes stale before anyone moves a row,
|
||||
// so the heading vouching for an event is not enough on its own.
|
||||
if (Date.parse(range.end.iso) < nowMs) continue;
|
||||
//
|
||||
// `latestBoundaryMs`, not `Date.parse`: these ends are day precision, and
|
||||
// the raw value is UTC midnight — a placeholder the countdown resolves to
|
||||
// each reader's own reset. Retiring the row on the placeholder drops it
|
||||
// while the app still shows it as live.
|
||||
if (latestBoundaryMs(range.end.iso, range.end.precision, ctx.game) < nowMs) {
|
||||
continue;
|
||||
}
|
||||
|
||||
out.push({
|
||||
id: eventId(ctx.game, title, range.start.iso),
|
||||
@@ -536,8 +544,12 @@ function parseInfinityNikkiEvents(
|
||||
if (range.end.iso <= range.start.iso) continue;
|
||||
|
||||
// "Current" is maintained by hand and goes stale before anyone moves a
|
||||
// row, so currency is checked rather than taken on trust.
|
||||
if (Date.parse(range.end.iso) < nowMs) continue;
|
||||
// row, so currency is checked rather than taken on trust — on the same
|
||||
// clock the countdown reads a day-precision end on, not on the UTC
|
||||
// midnight placeholder stored for it.
|
||||
if (latestBoundaryMs(range.end.iso, range.end.precision, ctx.game) < nowMs) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const id = eventId(ctx.game, title, range.start.iso);
|
||||
if (seen.has(id)) continue;
|
||||
|
||||
Reference in New Issue
Block a user