ReviewOS

stacks/ts-analytics

Sessions have no time index: ~14 endpoints full-scan the partition and silently truncate at scale

#171
Closed glennmichael123 opened this 9 days ago ·
9 days ago

sk=SESSION#{id} has no time key, so referrers/devices/browsers/os/countries/regions/cities/campaigns/comparison/stats/flow/entry-exit/funnels/goal-stats/insights read EVERY session then filter in JS; queryAllItems caps at 100k in arbitrary order — wrong numbers past that. flow/entry-exit/funnels/goal-stats never got the #151 fix and cap at one 1MB page; goal-stats denominator is all-time vs a date-bounded numerator. BONUS: session-detail timeline queries gsi1 with SESSION#{id} which can never match the DATE-keyed gsi1pk — permanently empty. Fix: startedAt-keyed GSI + convert all begins_with(sk, SESSION#) consumers; finish #151 on the four missed endpoints; fix the timeline GSI mismatch.

From the production-readiness audit (docs/research/production-readiness.md, eacf996). Verified with live probes where stated.

Sign in to comment on this issue.