fix(dlp,shdr): force-close a live entity once it retires from the feed - #322
Merged
Conversation
A seasonal show's run ends and it leaves the upstream feed entirely — no POI/facility entry, no wait-times row, nothing for buildLiveData() to key off. Dropping the row from the build achieves nothing: the collector is upsert-only with no delete path, so the last live value (often OPERATING) just sits there forever. Confirmed independently on two park modules: DLP's "Angel's Pop Star Party" frozen 50+ days, four SHDR shows frozen up to 17 days (#74, #83). Adds an opt-in retirement gate to Destination.getLiveData(): once a previously-live entity has been missing from a full buildLiveData() snapshot for longer than liveEntityRetirementMs (7 days by default), emit a synthetic {id, status: CLOSED} row — a genuine value change the collector will actually write, clearing the frozen state. Off by default and only ever applied to full snapshots; enabled explicitly on DisneylandParis and ShanghaiDisneylandResort, the two destinations where the pattern is confirmed. Also adds a small capture tool (src/tools/liveDataRetirement) that polls local live data and logs id/status/showtime-count per entity, to build a real absence-pattern dataset for tuning the retirement window over time. Scheduled hourly via cron against DLP and SHDR.
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.
Summary
A seasonal show's run ends and it leaves the upstream feed entirely — no
POI/facility entry, no wait-times row, nothing for
buildLiveData()to keyoff. Dropping the row from the build achieves nothing: the collector is
upsert-only with no delete path, so the last live value (often
OPERATING)just sits there forever. Confirmed independently on two park modules: DLP's
"Angel's Pop Star Party" frozen 50+ days, four SHDR shows frozen up to 17
days.
Fix
Adds an opt-in retirement gate to
Destination.getLiveData(): once apreviously-live entity has been missing from a full
buildLiveData()snapshot for longer than
liveEntityRetirementMs(7 days by default), emita synthetic
{id, status: 'CLOSED'}row — a genuine value change thecollector will actually write, clearing the frozen state.
scope === undefined)— a partial/streaming build's absentees carry no meaning.
DisneylandParisandShanghaiDisneylandResort,the two destinations where the pattern is confirmed. Not defaulted on
library-wide: a destination whose
buildLiveData()legitimately omitsentities for unrelated reasons would get them wrongly force-closed.
stale far longer (17 and 50+ days), so a week already improves on both by
an order of magnitude while tolerating a normal multi-day show hiatus.
Calibration data
Added
src/tools/liveDataRetirement/capture.ts— polls local live data forDLP/SHDR and logs
id/status/showtime-countper entity per poll. Nowrunning hourly via cron so the 7-day default can be checked against a real
absence-pattern dataset rather than guessed twice.
Testing
src/__tests__/liveEntityRetirement.test.ts— the shared mechanism inisolation (default-off, under-threshold, over-threshold, reappearance
resets the clock, scoped builds are never gated).
src/parks/dlp/__tests__/showRetirement.test.tsandsrc/parks/shdr/__tests__/showRetirement.test.ts— real park classeswired up, reproducing the exact frozen-show shape from each issue.
src/tools/liveDataRetirement/__tests__/capture.test.ts— purerow-formatting logic.
tsc --noEmitclean,npm run buildclean.
(
npm run dev -- disneylandparis/shanghaidisneylandresort) — livedata path unaffected, no crashes. (SHDR's
getEntities()fails on apre-existing, unrelated bug — a
theme-parkancestor id with unescaped;characters reaching an entity id — confirmed present onmainbeforethis branch; filed separately.)
Test plan
confirm the known frozen rows (Angel's Pop Star Party, SHDR 10th
Birthday Bash) actually clear once the retirement window elapses
🤖 Generated with Claude Code