-
Notifications
You must be signed in to change notification settings - Fork 1
Labels
application-serverSpring Boot server: APIs, business logic, databaseSpring Boot server: APIs, business logic, databasebugSomething isn't workingSomething isn't workingpriority:criticalDrop everything - Loss of functionality or dataDrop everything - Loss of functionality or datapriority:highAddress this sprint - Significant impactAddress this sprint - Significant impact
Milestone
Description
Bug Description
SlackWeeklyLeaderboardTask sends leaderboard notifications to a global Slack channel instead of using workspace-specific notification settings.
Current Behavior
File: leaderboard/tasks/SlackWeeklyLeaderboardTask.java:191-192
// CURRENT: Uses global properties for ALL workspaces
String team = leaderboardProperties.notification().team();
String channelId = leaderboardProperties.notification().channelId();
for (Workspace workspace : workspaces) {
// ... builds leaderboard ...
slackMessageService.sendMessage(channelId, blocks, "..."); // Same channel for everyone!
}Expected Behavior
for (Workspace workspace : workspaces) {
// Skip workspaces with notifications disabled
if (!Boolean.TRUE.equals(workspace.getLeaderboardNotificationEnabled())) {
continue;
}
// Use workspace-specific settings
String team = workspace.getLeaderboardNotificationTeam();
String channelId = workspace.getLeaderboardNotificationChannelId();
if (channelId == null || channelId.isBlank()) {
log.warn("Skipping workspace {}: no notification channel configured", workspace.getSlug());
continue;
}
// ... build and send leaderboard ...
}Impact
- All workspaces send to the same global Slack channel
- Workspace-specific
leaderboardNotificationChannelIdis never used - Workspace-specific
leaderboardNotificationTeamis never used - Workspace-specific
leaderboardNotificationEnabledis never checked - Multi-tenant Slack notifications are broken
Workspace Entity Fields (Exist But Unused)
// In Workspace.java - these fields exist but are ignored!
private Boolean leaderboardNotificationEnabled;
private String leaderboardNotificationTeam;
private String leaderboardNotificationChannelId;Additional Issue: SlackAppConfig Singleton
SlackAppConfig.java creates a singleton Slack App using global env vars. For true multi-tenant support, we need per-workspace Slack clients using workspace.getSlackToken().
Fix Approach
- Quick fix: Update
SlackWeeklyLeaderboardTaskto use workspace fields - Full fix: Also update
SlackAppConfigto support per-workspace Slack tokens
Related Issues
- Parent epic: feat(epic): workspace-scoped notification & multi-channel leaderboard Slack configuration #480
- feat(application-server): workspace notification settings persistence & API #481 (notification persistence)
- feat(application-server): Slack multi-channel dispatcher & test-send endpoint #483 (multi-channel dispatcher)
Acceptance Criteria
- Task checks
workspace.getLeaderboardNotificationEnabled()before sending - Task uses
workspace.getLeaderboardNotificationChannelId()per workspace - Task uses
workspace.getLeaderboardNotificationTeam()per workspace - Workspaces without channel configured are skipped with warning log
- Unit test verifies per-workspace channel usage
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
application-serverSpring Boot server: APIs, business logic, databaseSpring Boot server: APIs, business logic, databasebugSomething isn't workingSomething isn't workingpriority:criticalDrop everything - Loss of functionality or dataDrop everything - Loss of functionality or datapriority:highAddress this sprint - Significant impactAddress this sprint - Significant impact