Skip to content

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Jan 6, 2026

Summary

  • Fixed bug where industry alerts were not being posted to real Slack channels
  • The hasAlertedPerspective() check was blocking articles that had already been posted to website-only channels
  • Removed the redundant check since the SQL query already handles per-channel deduplication correctly
  • Cleaned up unused functions (hasAlertedPerspective, getPerspectivesToAlert)

Root Cause

The hasAlertedPerspective() function checked if a perspective was alerted to ANY channel, but the intended behavior was per-channel deduplication. This meant if an article was posted to a WEBSITE_ONLY_* channel first, it would never be posted to real Slack channels like C0A6J6RTTEY (Industry Agentic News).

The SQL query in getNextArticleForChannel() already handles this correctly with:

AND NOT EXISTS (
  SELECT 1 FROM industry_alerts ia
  WHERE ia.perspective_id = p.id
    AND ia.channel_id = $2  -- Per-channel filter
)

Test plan

  • TypeScript compiles without errors
  • All 179 unit tests pass
  • After deploy, verify alerts start flowing to Industry Agentic News channel

🤖 Generated with Claude Code

bokelley and others added 2 commits January 5, 2026 16:18
The `hasAlertedPerspective()` check was blocking articles from being
posted to real Slack channels if they had already been posted to
website-only channels. The function checked if a perspective was
alerted to ANY channel, but the SQL query already handles per-channel
deduplication via the NOT EXISTS clause with channel_id filter.

Changes:
- Remove redundant hasAlertedPerspective() call from processAlerts()
- Remove unused hasAlertedPerspective() function
- Remove unused getPerspectivesToAlert() function (had same bug)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 2256578 into main Jan 6, 2026
6 checks passed
bokelley added a commit that referenced this pull request Jan 6, 2026
* fix: industry alerts not posting to Slack channels

The `hasAlertedPerspective()` check was blocking articles from being
posted to real Slack channels if they had already been posted to
website-only channels. The function checked if a perspective was
alerted to ANY channel, but the SQL query already handles per-channel
deduplication via the NOT EXISTS clause with channel_id filter.

Changes:
- Remove redundant hasAlertedPerspective() call from processAlerts()
- Remove unused hasAlertedPerspective() function
- Remove unused getPerspectivesToAlert() function (had same bug)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: sync package-lock.json version

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.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.

2 participants