Skip to content

feat(destination): shared appwatch version fetcher#230

Merged
cubehouse merged 1 commit into
mainfrom
feat/shared-appwatch-version
Jun 24, 2026
Merged

feat(destination): shared appwatch version fetcher#230
cubehouse merged 1 commit into
mainfrom
feat/shared-appwatch-version

Conversation

@cubehouse

Copy link
Copy Markdown
Member

Summary

  • Extract Tokyo Disney's appwatch-based App-Version fetcher into the Destination base class as getAppwatchVersion(packageId, fallback). Any park can now ride the live Play Store version without per-park boilerplate.
  • Wire Shanghai Disney Resort to it. Disney's live app sends App-Version 13.8.0; we were hardcoded to 13.5.0. Not enforced today, but trivial to keep in sync now that the helper exists.
  • Refactor Tokyo Disney Resort onto the shared helper. Its 400 → clear cached app version recovery path is preserved; the cache key was updated to match the new method name.

Ops note

The fallback chain for Shanghai is: appwatch → SHDR_APPVERSION env → ''. Production collector env should add SHDR_APPVERSION=13.8.0 so the fallback is meaningful if appwatch ever stalls. Appwatch is reachable today (returning 13.7.0), so the live path is what's in use.

Test plan

  • npm test — 58/58 files, 1238/1238 tests (was 57/1233 on main; +1 file, +5 new tests for the shared helper)
  • npm run dev -- tokyodisneyresort — 4/4 (live App-Version still pulled, all entity/live/schedule contracts pass)
  • npm run dev -- shanghaidisneylandresort — 3/4: 80 live entries (26 with wait times), 77 schedules / 812 days. The 4th failure is the pre-existing ID_CHARSET harness check that rejects Shanghai's semicolon-delimited IDs (introduced in fec57568, unrelated to this PR).

Extract Tokyo Disney's app-version-from-Play-Store helper into the
Destination base class as getAppwatchVersion(packageId, fallback) so any
park whose API gates on App-Version can ride the live published version
without manual bumps.

Wire Shanghai Disney to it (Disney started sending live App-Version
13.8.0 against our hardcoded 13.5.0 - not enforced today, but trivial to
keep in sync), refactor Tokyo Disney to use the shared helper, and cover
the base method with vitests (happy path, missing field, fetch throws,
default empty fallback, per-package-id cache isolation).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cubehouse cubehouse merged commit da283f6 into main Jun 24, 2026
4 checks passed
@cubehouse cubehouse deleted the feat/shared-appwatch-version branch June 24, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant