chore(slack): remove dead invite path, archive checkSlackJoins poller
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:
parent
7b326f879d
commit
d15458b30a
10 changed files with 247 additions and 197 deletions
|
|
@ -17,7 +17,6 @@ export const ALERT_THRESHOLDS = {
|
|||
// Single source of truth for alert presentation. Used by detectors AND the
|
||||
// dismissed-list endpoint (which has no access to a detector run's output).
|
||||
export const ALERT_METADATA = {
|
||||
slack_invite_failed: { title: 'Slack invites failed', severity: 'critical' },
|
||||
no_slack_handle_week: { title: 'Active members without a Slack handle', severity: 'attention' },
|
||||
stuck_pending_payment: { title: 'Members stuck in pending payment', severity: 'attention' },
|
||||
member_suspended: { title: 'Suspended members', severity: 'attention' },
|
||||
|
|
@ -62,18 +61,6 @@ function memberItem(member, sublabel) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function detectSlackInviteFailed() {
|
||||
await connectDB()
|
||||
const members = await Member
|
||||
.find({ slackInviteStatus: 'failed' })
|
||||
.select('name email')
|
||||
.lean()
|
||||
return {
|
||||
...alertShell('slack_invite_failed'),
|
||||
items: members.map((m) => memberItem(m))
|
||||
}
|
||||
}
|
||||
|
||||
export async function detectNoSlackHandleAfterWeek() {
|
||||
await connectDB()
|
||||
const cutoff = daysAgo(ALERT_THRESHOLDS.NO_SLACK_DAYS)
|
||||
|
|
@ -257,7 +244,6 @@ export async function detectPendingTagSuggestions() {
|
|||
}
|
||||
|
||||
const DETECTORS = [
|
||||
detectSlackInviteFailed,
|
||||
detectNoSlackHandleAfterWeek,
|
||||
detectStuckPendingPayment,
|
||||
detectSuspendedMembers,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue