chore(slack): remove dead invite path, archive checkSlackJoins poller
Some checks failed
Test / vitest (push) Successful in 12m6s
Test / playwright (push) Failing after 9m39s
Test / visual (push) Failing after 9m28s
Test / Notify on failure (push) Successful in 2s

Wave-based onboarding makes the auto-invite + polling path obsolete.

- Removes SlackService.inviteUserToSlack — admins now send invites
  through Slack's UI and flip the flag in our admin endpoint.
- Removes the slack_invite_failed admin alert + its detector. The
  alert no longer has a meaningful trigger (we don't attempt invites).
- Archives server/utils/checkSlackJoins.js (and its test) under
  _archive/ in case the polling pattern is needed again post-pilot.
- Deletes the Nitro plugin that scheduled checkSlackJoins on boot
  + hourly. Nothing in nitro.config / nuxt.config / package.json
  registered it elsewhere.
- Drops the slack_invite_failed branch from adminAlerts.test; the
  enum slug stays in adminAlertDismissal so historical dismissal
  rows continue to validate.

notifyNewMember (vetting-channel notification) and findUserByEmail
(used by the auto-flag helper) are retained.
This commit is contained in:
Jennie Robinson Faber 2026-04-29 12:34:21 +01:00
parent 7b326f879d
commit d15458b30a
10 changed files with 247 additions and 197 deletions

View file

@ -1,29 +0,0 @@
// server/plugins/check-slack-joins.js
import { checkSlackJoins } from '../utils/checkSlackJoins.js'
const INTERVAL_MS = 3600000 // 1 hour
export default defineNitroPlugin(() => {
// Don't run in test environment
if (process.env.NODE_ENV === 'test') return
const config = useRuntimeConfig()
const token = config.slackBotToken
if (!token) {
console.warn('[check-slack-joins] No Slack bot token configured, skipping background job')
return
}
async function run() {
try {
await checkSlackJoins(token)
} catch (err) {
console.error('[check-slack-joins] Unhandled error:', err.message || err)
}
}
// Run immediately on server start, then every hour
run()
setInterval(run, INTERVAL_MS)
})