apache / apache/rocketmq-dashboard

[Studio][Bug] Saving the AI/LLM configuration silently wipes the DingTalk/SMS/email notification channels

Open
#4,280 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.4k
Forks
683
Avg merge
2d 14h
Merged PRs (30d)
58

Description

## Problem / Evidence

`LlmConfigService.saveConfig`(`server/src/main/java/org/apache/rocketmq/studio/ops/ai/LlmConfigService.java`)重建完整 `GeneralSettingsVO` 时复制了 theme/compact/desktopNotify/notifySound/sessionTimeout/requireLogin 与全部 LLM 字段,但**未复制 `dingtalkWebhook`/`smsWebhook`/`emailRecipients`**。`SettingsService.saveGeneralSettings` 的空值回填仅覆盖 apiKey、dingtalkSigningSecret、llmEngine、deploymentName、apiVersion、awsRegion、maxTokens、temperature——没有通知渠道分支。`MybatisPlusSettingsRepository.saveGeneralSettings` 将整个 VO 序列化后覆盖单例 `rmq_settings` 行。

因此保存一次 AI/LLM 配置即把三个通知渠道字段持久化为 null:

1. `POST /api/settings/general/save` 配置 `dingtalkWebhook`/`smsWebhook`/`emailRecipients`;
2. `POST /api/llm/config` 保存任一 LLM 配置 → 200;
3. `GET /api/settings/general` → 三个字段均为 null(`dingtalkWebhookConfigured=false`);
4. 触发告警后 outbox 重试耗尽,`FAILED` 且 `last_error="No configured dingtalk webhook"`(NotificationOutboxService.sendWebhook/sendEmail 对未配置渠道的既定报错)。

回归测试(先红):`LlmConfigServiceTest.saveConfigShouldPreserveNotificationChannelFields` 在未修复代码上 `expected: "https://oapi.dingtalk.com/..." but was: null`。

## Impact

管理员的全部钉钉/短信/邮件告警通知在一次 AI 设置保存后被静默禁用;设置 UI 显示渠道未配置;测试通知按钮报"No configured dingtalk webhook"。告警通知是 Studio 告警体系的核心交付面。

## Expected behavior

LLM 配置保存只应更新 LLM 字段,通知渠道字段应与其他被保护的设置一样从存储值保留。

## Related work

- #2963(已合并 fd2fa6c3)为反方向(general 保存不得抹掉 LLM 字段)落地了空值回填;本缺陷是同契约在 LLM→通知方向上的缺口。
- #2863(closed,**未合并**,mergedAt=null)曾提出对 partial saves 保留 unmanaged 字段的更宽方案,但其修复从未落地,且已关闭——该缺口仍开放。

## PR

Fix: #4284.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with LlmConfigService.java and run LlmConfigServiceTest.saveConfigShouldPreserveNotificationChannelFields, which is reported to fail on the current code. Read SettingsService.saveGeneralSettings and MybatisPlusSettingsRepository.saveGeneralSettings to trace the persisted GeneralSettingsVO. Done means saving an LLM configuration leaves dingtalkWebhook, smsWebhook, and emailRecipients intact and the regression test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.