Skip to content

Comments

fix: prevent Wingbits API stampede in theater posture#378

Open
bobo wants to merge 1 commit intokoala73:mainfrom
bobo:fix/wingbits-theater-posture-stampede
Open

fix: prevent Wingbits API stampede in theater posture#378
bobo wants to merge 1 commit intokoala73:mainfrom
bobo:fix/wingbits-theater-posture-stampede

Conversation

@bobo
Copy link

@bobo bobo commented Feb 25, 2026

Summary

  • Theater posture handler used manual getCachedJson/setCachedJson with no request coalescing
  • During the ~15s window between cache miss and cache write, every concurrent request fired its own POST to Wingbits /v1/flights with 9 bounding boxes — causing ~1500 requests/min
  • Switch to cachedFetchJson which deduplicates concurrent in-flight requests via a shared promise, so only one upstream fetch runs at a time

Test plan

  • Deploy to preview and monitor Wingbits API call volume — should drop from ~1500/min to ~1 per 5 min (cache TTL)
  • Verify theater posture panel still renders correctly
  • Verify stale/backup fallback still works when both OpenSky and Wingbits are down

🤖 Generated with Claude Code

…stampede

The theater posture handler used manual getCachedJson/setCachedJson which
has no request coalescing. During the window between a cache miss and the
cache write completing (~15s Wingbits timeout), every concurrent request
bypassed the cache and fired its own POST to Wingbits with 9 bounding
boxes — causing ~1500 requests/min.

Switch to cachedFetchJson which deduplicates concurrent in-flight
requests via a shared promise, so only one upstream fetch runs at a time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 25, 2026

@bobo is attempting to deploy a commit to the Elie Team on Vercel.

A member of the Team first needs to authorize it.

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