Skip to content

Chunk analytics snapshots; remove dirty DEFINE EVENT - #14

Merged
rivertam merged 1 commit into
mainfrom
fix/analytics-chunked-snapshot
Aug 10, 2026
Merged

Chunk analytics snapshots; remove dirty DEFINE EVENT#14
rivertam merged 1 commit into
mainfrom
fix/analytics-chunked-snapshot

Conversation

@rivertam

Copy link
Copy Markdown
Owner

Summary

Also trying an ops mitigation in parallel: point SURREALDB_ENDPOINT at http://… instead of ws://… to avoid websocket frame resets on large responses.

Test plan

  • just check
  • After deploy: /analytics?range=7d shows metrics (not standby)
  • Confirm Railway logs no longer spam analytics snapshot query failed: Connection reset
  • Confirm /lifting and /spire still load
  • Leave ANALYTICS_FACTS_BACKFILL unset

Made with Cursor

A single multi-day analytics_events SELECT was resetting the shared SurrealDB
connection (taking fitness refreshes and beacons with it). Load one UTC day at
a time with an explicit projection, and remove the per-write dirty event until
fact backfill is deliberately re-enabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rivertam
rivertam merged commit 3f8a215 into main Aug 10, 2026
1 check passed
@rivertam
rivertam deleted the fix/analytics-chunked-snapshot branch August 10, 2026 01:50
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