Skip to content

feat(addie): auto-reconcile Slack ↔ WorkOS account links daily#1304

Merged
bokelley merged 1 commit intomainfrom
bokelley/porto-v8
Mar 2, 2026
Merged

feat(addie): auto-reconcile Slack ↔ WorkOS account links daily#1304
bokelley merged 1 commit intomainfrom
bokelley/porto-v8

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Mar 1, 2026

Summary

  • Extracts bulk email-matching logic from POST /api/admin/slack/auto-link-suggested into a shared autoLinkUnmappedSlackUsers() function in slack/sync.ts
  • Adds a daily background job that runs it 2 minutes after startup (to fix existing unmapped users) and every 24 hours thereafter
  • Removes the no-op wrapper job file per code review — autoLinkUnmappedSlackUsers is registered directly in job-definitions.ts

Why

Slack → WorkOS mapping is checked by isSlackUserAAOAdmin to grant Addie admin tools. Existing users who predate the auto-link logic (or whose events weren't caught) had no path to get linked without manual admin intervention.

Test plan

  • Deploy and check logs ~2 minutes after startup — expect slack-auto-link job log if any unmapped users exist
  • Verify POST /api/admin/slack/auto-link-suggested still works (response shape preserved)
  • All 304 tests passing

🤖 Generated with Claude Code

Extracts the bulk email-matching logic from the admin POST endpoint into
a shared autoLinkUnmappedSlackUsers() in slack/sync.ts, then registers a
daily background job that runs it. The job fires 2 minutes after startup
to fix existing unmapped users (like Matt Egol) and every 24 hours to
catch future stragglers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bokelley bokelley merged commit 900d347 into main Mar 2, 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