Repository navigation
fix(display): group event buckets by app-space track, not histogram - #2933
Merged
Merged
Conversation
release: promote event display date-window fix (DEV \u2192 main)
…histogram
The event display-app's views (Most Popular Tracks, Finished by Topic,
Who's on Fire, Topic Distribution, Activity Ticker) rendered the wrong
labels — "1 tutorial / 2 tutorials…" — because getEventBuckets returned a
per-attendee completion histogram while every consumer (socket, DonutChart,
TrendingView, leaderboards, ticker) expects completions grouped by name.
The prior date-window fix made the (mis-shaped) histogram data appear,
surfacing the long-standing mismatch.
Group buckets by TRACK instead, reusing the SAME resolution the app-space
page uses (no new grouping invented):
event → mission (Events.mission_ID, else Missions.event_ID backlink)
→ CompletionPaths (each = one track, label = CompletionPaths.name)
→ completions matched to a track via CompletionPathItems, with GROUP
items expanded through GroupPathItems to child tutorials
Window-scoped to [startDate,endDate]; distinct users per track.
New shared lib srv/lib/event-path-buckets.js is the single source of truth:
- computePathBuckets() — used by BOTH the anonymous EventStreamService AND
the authed DisplayService getEventBuckets (both previously keyed on the
always-NULL event_ID → empty results).
- trackNamesForTutorial() — the realtime socket emit now labels each live
completion with its track name(s) in the active event's mission (one emit
per matching track), replacing the primaryTag keying that never matched
the bucket names. Completions outside every track emit nothing.
Verified against PROD event 10000002: returns real tracks ("ABAP":2,
"Joule Studio":1) resolved via the Missions.event_ID backlink.
This was referenced Oct 26, 2026
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.
Summary
The event display-app's content views ("Most Popular Tracks", "Finished by Topic", "Who's on Fire", "Topic Distribution", Activity Ticker) showed the wrong labels — rows like "1 tutorial / 2 tutorials / 3 tutorials" instead of real names.
Root cause:
getEventBucketsreturned a per-attendee completion histogram, but every display consumer (socket keying, DonutChart, TrendingView, both leaderboards, ticker) is written to render completions grouped by name. Two incompatible groupings shared onebucketsarray. The earlier date-window fix populated the (mis-shaped) histogram, surfacing the mismatch.Fix: group buckets by track =
CompletionPathsunder the event's mission — the same resolution the app-space page uses. No new grouping invented.Window-scoped to
[startDate,endDate]; distinct users per track.Changes
srv/lib/event-path-buckets.js(new) — single source of truth.computePathBuckets()+trackNamesForTutorial()+ sharedresolveEventMissionId()/buildTrackMap()helpers.srv/event-stream-service.js(anonymous display) —getEventBuckets→computePathBuckets.srv/display-service.js(authed admin) — same fix; it had the identicalevent_ID-always-NULL bug (returned[]).srv/developer-service.js(realtime socket) — live completions now labeled with their track name(s) in the active event's mission (one emit per track), replacingprimaryTagkeying that never matched bucket names. Completions outside every track emit nothing.Verification
event-path-buckets.test.jsincl. GROUP-expansion + distinct-user counting; updated event-stream + display-service specs)."ABAP":2,"Joule Studio":1), resolved via theMissions.event_IDbacklink (the event'smission_IDis NULL — the known FK trap, handled).Test plan