Skip to content

Restore analytics raw snapshot; pause fact backfill - #13

Merged
rivertam merged 1 commit into
mainfrom
fix/analytics-raw-snapshot
Aug 9, 2026
Merged

Restore analytics raw snapshot; pause fact backfill#13
rivertam merged 1 commit into
mainfrom
fix/analytics-raw-snapshot

Conversation

@rivertam

@rivertam rivertam commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • After Stop analytics fact rebuilds from starving SurrealDB #12, /analytics still standby: logs show continuous fact backfill plus Connection reset / 3s snapshot timeouts.
  • Drop the nested session_id IN (SELECT … whole window) from the legacy snapshot; probe only the 30-minute idle window and intersect in Rust; raise the raw timeout to 8s.
  • Make ANALYTICS_FACTS_BACKFILL=1 opt-in so deploy stops the worker by default and the dashboard can recover.

Test plan

  • just check
  • Merge/deploy without setting ANALYTICS_FACTS_BACKFILL
  • Confirm Railway logs show backfill worker idle
  • Confirm https://benjisponge.com/analytics?range=7d (and 30d/90d) render metrics
  • Only later: set ANALYTICS_FACTS_BACKFILL=1 when deliberately finishing fact rollout

Made with Cursor

The nested prior-session IN still re-scanned the whole window and timed out
under SurrealDB contention, and the leased backfill kept resetting connections
after #12. Intersect the idle-window candidates in Rust, give the raw path
eight seconds, and leave the backfill worker off until explicitly enabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rivertam
rivertam merged commit 7194b82 into main Aug 9, 2026
1 check passed
@rivertam
rivertam deleted the fix/analytics-raw-snapshot branch August 9, 2026 23:18
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