Repository navigation
fix(universalbeijing): cache the perform list for 60 s, not 3 h - #701
Merged
Merged
Conversation
The perform list carries each show's live status and today's remaining showtimes, and it changes through the day. Cached for 3 hours at both the HTTP and method layer, a show's times and status could be up to 3 hours old, and two instances that fetched at different moments disagreed for that long. Cache it for 60 s, the same as the attraction list. Co-Authored-By: Claude Opus 5.5 <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.
What
Universal Studios Beijing's perform list (
/map/perform/list/v2) is the source for every show's live status and today's showtimes. It was cached for 3 hours at both layers:fetchShowData:@http({cacheSeconds: 10800})getShowData:@cache({ttlSeconds: 10800})Both are now 60 s, the same as the attraction list (
fetchAttractionData/getAttractionData).Why
The list changes through the day: showtimes drop off and are added, and shows open and close. With a 3 hour cache a show's times and status could be up to 3 hours old. Two instances that filled their caches at different moments also served different answers for up to 3 hours, so a consumer reading both saw a show's times flip back and forth.
buildEntityListreads the same list, so it now refreshes at the attraction list's rate too. That is one small JSON GET a minute, the same as the attraction list already costs.Before / after (real feed, 2026-11-03 18:46 CST)
A live fetch with this branch, compared with output built from a perform list cached earlier the same afternoon. 9 of 21 shows differ:
The other 12 shows match. No status differed in this sample, and no entity ids change.
Tests
src/parks/universalbeijing/__tests__/showCache.test.ts, 3 new tests. Two fail onmain(expected 10800 to be 60, and the method cache serving a second call 61 s later from cache):getShowDatare-reads the list after 61 s and returns the new stategetShowDatastill answers from cache inside the 60 s windowThe existing scare-zone tests pass unchanged. Typecheck and lint are clean.