Repository navigation
HELD: multiple events draws the first map at once; /api/events only brings the names - #10
Draft
pietechsolution wants to merge 1 commit into
Draft
pietechsolution wants to merge 1 commit into
pietechsolution wants to merge 1 commit into
Conversation
…e names The event keys are public config, but the switcher mounted no map until /api/events answered. On the live demo that route (a server-SDK read per event) took 370-940 ms, so the seat map's bootstrap waited behind it. The switcher now starts from the configured events with their placeholder names and selects the first one straight away. When the route answers, the names are replaced in place, so the open map and any hold on it stay. If the route fails, the placeholder names stay and every map still works.
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.
HELD. Demo speed: the multiple events page stops waiting on
/api/eventsbefore drawing its map.Why
The live demo at seatlayer.io/demo/sdk/multiple-events regressed from 1.5 s to 2.5–2.7 s cold (headless Chromium, BLR, 2026-09-29). The SeatLayer API was not the cause:
GET /v1/events/:keyp50 fell from 356 to 264 ms. The switcher mounted no map untilGET /api/eventsanswered, and that route (one server-SDK read per event) takes 370–940 ms from India, measured with curl ×6. Bootstrap only starts after it.What
The event keys are public build-time config. The list with its placeholder names moves to
lib/config.ts(configuredEvents), and the route reads the same list.configuredEventsand selects the first event at once, so the map loads immediately./api/eventsanswers, the names are replaced in place. The open map (same key, same position) and any hold on it stay; nothing reloads.Why not an edge cache
An edge cache would only hide the route's latency on a hit, and would need Cloudflare-specific cache code in a public example. The map never needed the names, so removing the dependency is simpler, and nothing can go stale.
Secret safety
Unchanged.
SEATLAYER_SECRET_KEYis still read only inside the route handler. The response still carries only{ key, name }and a source label. No new cache, header or log line.Measured (local
next start, live demo public keys, prod API;/api/eventsmade slow by a refused test key, ~615 ms)/api/eventsanswers, then the chart chunk loads)/api/eventsis still pending)The "after" on prod gets measured once the demo Worker is redeployed from main.
Checks
npx tsc --noEmitOK.next buildOK (the/multiple-eventspage is 1.98 kB).Edge case
With only one event key configured and a secret key set, the page now shows three tabs with the same real name. Before, the route's deduplicated list showed one. The live demo configures three distinct keys, so it's unaffected.