fix: confine single-origin benches to their pinned region in overlayEditorial - #2276
Merged
Conversation
…layEditorial The previous guard lived in page.tsx and only reached the `benchmark` prop; `variants` was seeded from the unfiltered aggregate a few lines earlier and shipped every region the worker computed into the RSC payload (us-east series and ranks for keyed-rpc-robinhood, on a page that only shows Singapore). Moving the confinement into overlayEditorial, where this build's spec is already overlaid on the stored snapshot, scopes the object at the source: aggregate, variants, filtered variants and list views all inherit it. Benches that declare region tabs, or pin nothing, are untouched. Also covers the 7d and 30d per-region series the page guard missed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CpArutAtXuBb1BVNUDXoYA
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.
Follow-up to #2274, which did not close the leak.
Why #2274 missed it: the guard was applied to the
benchmarkvariable inpage.tsx, butvariantsis seeded from the unfilteredaggregatea few lines earlier and passed to<BenchmarkBody>. RSC deduplication made it visible: the us-east arrays were inline and the sgp arrays were$refs back to the already-serialized (stripped)benchmarkprop.This change:
confineToPinnedRegion(b, spec)insrc/lib/spec.ts, called at the end ofoverlayEditorial, where this build's spec is already overlaid on the stored snapshot. When the spec declares no region dimension and pins one viaaggregate_filters.region,extras.regions,seriesByRegion{24h,7d,30d}andcellRanksare reduced to that region. Benches that declare region tabs, or pin nothing, are returned untouched.page.tsxgoes back toconst benchmark = aggregate;.Replayed on the live blob with main's spec: regions
["sgp"], per-region series["sgp"], cellRanks["all|sgp"], 3 results. With dev's spec (tabs declared): both regions kept.tscandeslintclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01CpArutAtXuBb1BVNUDXoYA