Skip to content

fix(universalbeijing): cache the perform list for 60 s, not 3 h - #701

Merged
cubehouse merged 1 commit into
mainfrom
fix/universalbeijing-show-cache
Nov 3, 2026
Merged

cubehouse merged 1 commit into
mainfrom
fix/universalbeijing-show-cache

Conversation

@cubehouse

Copy link
Copy Markdown
Member

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.

buildEntityList reads 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:

Show Cached earlier (before) Live fetch (after)
Untrainable 16:00 17:15 18:00 19:00 19:00
SING on Tour! 16:00 16:30 17:00 17:30 18:00 18:30 19:00 19:30 19:00 19:30
Universal Pop 17:00 14:00 15:45 17:00
Universal's Halftime Show 2 times 3 times
Frog Choir 1 time 3 times
WaterWorld Stunt Show 2 times 3 times
Po Live 5 times 3 times
Transformers: More than Meets the Eye 6 times 3 times
Minions Cream Soda Show 3 times 1 time

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 on main (expected 10800 to be 60, and the method cache serving a second call 61 s later from cache):

  • the perform list request is queued with a 60 s HTTP cache, equal to the attraction list's
  • getShowData re-reads the list after 61 s and returns the new state
  • getShowData still answers from cache inside the 60 s window

The existing scare-zone tests pass unchanged. Typecheck and lint are clean.

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>
@cubehouse
cubehouse merged commit 6add69f into main Nov 3, 2026
4 checks passed
@cubehouse
cubehouse deleted the fix/universalbeijing-show-cache branch November 3, 2026 13:23
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