feat(destination): shared appwatch version fetcher#230
Merged
Conversation
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>
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
Destinationbase class asgetAppwatchVersion(packageId, fallback). Any park can now ride the live Play Store version without per-park boilerplate.13.8.0; we were hardcoded to13.5.0. Not enforced today, but trivial to keep in sync now that the helper exists.400 → clear cached app versionrecovery path is preserved; the cache key was updated to match the new method name.Ops note
The fallback chain for Shanghai is: appwatch →
SHDR_APPVERSIONenv →''. Production collector env should addSHDR_APPVERSION=13.8.0so the fallback is meaningful if appwatch ever stalls. Appwatch is reachable today (returning13.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-existingID_CHARSETharness check that rejects Shanghai's semicolon-delimited IDs (introduced infec57568, unrelated to this PR).