Skip to content

feat: add slack_users table to cache user ID to real name mapping#104

Open
jee7s wants to merge 2 commits into
mainfrom
feat/slack-user-table
Open

feat: add slack_users table to cache user ID to real name mapping#104
jee7s wants to merge 2 commits into
mainfrom
feat/slack-user-table

Conversation

@jee7s

@jee7s jee7s commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

Adds a slack_users table with user_id (PK), real_name, display_name, and updated_at. On each event processed, the agent looks up the user's Slack profile and upserts their name into the table in the background (non-blocking, non-critical). This lets the audit log be correlated to real names without storing names in the audit_log table itself.

Changes:

  • db: new slackUsers table in Postgres and SQLite schemas
  • db: UserStore interface and PostgresUserStore / SqliteUserStore impls
  • db: migration 0001_slack_users.sql
  • agent/slack: lookupSlackUser() fetches profile via users.info API
  • agent/index: upsert user on every processEvent (fire-and-forget)

jee7s and others added 2 commits April 14, 2026 11:25
Adds a slack_users table with user_id (PK), real_name, display_name,
and updated_at. On each event processed, the agent looks up the user's
Slack profile and upserts their name into the table in the background
(non-blocking, non-critical). This lets the audit log be correlated to
real names without storing names in the audit_log table itself.

Changes:
- db: new slackUsers table in Postgres and SQLite schemas
- db: UserStore interface and PostgresUserStore / SqliteUserStore impls
- db: migration 0001_slack_users.sql
- agent/slack: lookupSlackUser() fetches profile via users.info API
- agent/index: upsert user on every processEvent (fire-and-forget)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tle user lookups

drizzle-kit migrate only applies journaled migrations — without the
_journal.json entry the slack_users table was never created in deployed
Postgres and every upsert failed (downgraded to console.warn). Also skip
the per-message users.info lookup + upsert when the user was refreshed in
the last 24h.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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