From 301ed797ea411143bf61be98ccbb9602528ad08b Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 31 May 2026 20:54:05 -0400 Subject: [PATCH] fix: suppress park-page weather-delay flag during wind-down too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same root cause as 52f7efd — the /rides endpoint also used isWithinOperatingWindow, which includes the post-close buffer. Switch to getOperatingStatus and gate the badge on status === "open" so the park page matches the calendar. Co-Authored-By: Claude Opus 4.7 --- backend/src/routes/rides.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/src/routes/rides.ts b/backend/src/routes/rides.ts index 50b6c82..19799f3 100644 --- a/backend/src/routes/rides.ts +++ b/backend/src/routes/rides.ts @@ -2,7 +2,7 @@ import { Hono } from "hono"; import { PARK_MAP } from "../../../lib/parks"; import { QUEUE_TIMES_IDS } from "../../../lib/queue-times-map"; import { getCoasterSet } from "../../../lib/coaster-data"; -import { getTodayLocal, isWithinOperatingWindow } from "../../../lib/env"; +import { getTodayLocal, getOperatingStatus } from "../../../lib/env"; import { fetchLiveRides } from "../../../lib/scrapers/queuetimes"; import { scrapeRidesForDay } from "../../../lib/scrapers/sixflags"; import { fetchFastLaneWaits, lookupFastLane } from "../../../lib/scrapers/sixflags-waittimes"; @@ -21,9 +21,10 @@ app.get("/:id/rides", async (c) => { const today = getTodayLocal(); const todayData = getDayData(id, today); - const withinWindow = todayData?.hoursLabel - ? isWithinOperatingWindow(todayData.hoursLabel, park.timezone) - : false; + const operatingStatus = todayData?.hoursLabel + ? getOperatingStatus(todayData.hoursLabel, park.timezone) + : "closed"; + const withinWindow = operatingStatus !== "closed"; const queueTimesId = QUEUE_TIMES_IDS[id]; let liveRides: LiveRidesResult | null = null; @@ -90,8 +91,13 @@ app.get("/:id/rides", async (c) => { } } + // Only flag weather delay during scheduled hours — during the post-close + // wind-down buffer, all-rides-closed is just normal closing, not weather. const isWeatherDelay = - withinWindow && liveRides !== null && liveRides.rides.length > 0 && liveRides.rides.every((r) => !r.isOpen); + operatingStatus === "open" && + liveRides !== null && + liveRides.rides.length > 0 && + liveRides.rides.every((r) => !r.isOpen); let scheduleFallback = null; if (!liveRides) {