Skip to content

fix: compute engagement scores for Slack-only users#664

Merged
bokelley merged 1 commit into
mainfrom
bokelley/debug-engagement-display
Jan 7, 2026
Merged

fix: compute engagement scores for Slack-only users#664
bokelley merged 1 commit into
mainfrom
bokelley/debug-engagement-display

Conversation

@bokelley

@bokelley bokelley commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Slack-only users (those who haven't signed up for an AAO account yet) were showing empty engagement scores in the admin dashboard
  • Updated the unified_contacts view to compute scores on-the-fly for Slack-only contacts based on their actual activity data
  • Uses LATERAL joins for efficient single-pass computation

What Changed

Adds migration 148 that updates the view to compute:

  • Slack activity score (0-30 points): Messages, reactions, thread replies from last 30 days
  • Conversation score (0-25 points): Addie conversations and insights from last 30 days

Test plan

  • Migration applies successfully in Docker
  • View schema is correct with engagement_score column
  • All existing tests pass
  • TypeScript type check passes

🤖 Generated with Claude Code

Slack-only users (those who haven't signed up for an AAO account) were
showing empty engagement scores in the admin dashboard. This updates the
unified_contacts view to compute scores on-the-fly based on:
- Slack activity (messages, reactions, thread replies) from last 30 days
- Addie conversations and insights from last 30 days

Uses LATERAL joins for efficient single-pass computation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 0383ae7 into main Jan 7, 2026
6 checks passed
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