fix(email-config): Do not prompt for email configuration issues when email notifications are disabled#693
Merged
linyuchen merged 1 commit intoLLOneBot:devfrom Jan 25, 2026
Merged
Conversation
…email notifications are disabled
Contributor
评审者指南(在小型 PR 上折叠)评审者指南当邮件通知被禁用时,通过对已禁用配置短路验证,允许在没有 SMTP 详细信息的情况下保存邮件配置。 邮件配置验证(通知已禁用时)的时序图sequenceDiagram
actor User
participant UI
participant EmailConfigManager
User->>UI: submitEmailConfig(config)
UI->>EmailConfigManager: validateConfig(config)
alt emailNotificationsDisabled
EmailConfigManager-->>UI: ValidationResult(valid: true, errors: [])
else emailNotificationsEnabled
EmailConfigManager->>EmailConfigManager: check smtp.host
EmailConfigManager->>EmailConfigManager: check other smtp fields
EmailConfigManager-->>UI: ValidationResult(valid: boolean, errors: string[])
end
UI-->>User: showSaveResult()
EmailConfigManager 验证变更的类图classDiagram
class EmailConfig {
bool enabled
SmtpConfig smtp
}
class SmtpConfig {
string host
int port
string username
string password
}
class ValidationResult {
bool valid
string[] errors
}
class EmailConfigManager {
+ValidationResult validateConfig(EmailConfig config)
}
EmailConfig o-- SmtpConfig
EmailConfigManager ..> EmailConfig
EmailConfigManager ..> ValidationResult
EmailConfigManager ..> SmtpConfig
文件级变更
可能关联的问题
提示与命令与 Sourcery 交互
自定义你的使用体验前往你的 控制台 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideAllows saving email configuration without SMTP details when email notifications are disabled by short-circuiting validation for disabled configurations. Sequence diagram for email configuration validation with disabled notificationssequenceDiagram
actor User
participant UI
participant EmailConfigManager
User->>UI: submitEmailConfig(config)
UI->>EmailConfigManager: validateConfig(config)
alt emailNotificationsDisabled
EmailConfigManager-->>UI: ValidationResult(valid: true, errors: [])
else emailNotificationsEnabled
EmailConfigManager->>EmailConfigManager: check smtp.host
EmailConfigManager->>EmailConfigManager: check other smtp fields
EmailConfigManager-->>UI: ValidationResult(valid: boolean, errors: string[])
end
UI-->>User: showSaveResult()
Class diagram for EmailConfigManager validation changeclassDiagram
class EmailConfig {
bool enabled
SmtpConfig smtp
}
class SmtpConfig {
string host
int port
string username
string password
}
class ValidationResult {
bool valid
string[] errors
}
class EmailConfigManager {
+ValidationResult validateConfig(EmailConfig config)
}
EmailConfig o-- SmtpConfig
EmailConfigManager ..> EmailConfig
EmailConfigManager ..> ValidationResult
EmailConfigManager ..> SmtpConfig
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - 我已经审查了你的更改,看起来很棒!
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的审查。
Original comment in English
Hey - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Collaborator
|
感谢 PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue: #690
Summary by Sourcery
Bug Fixes:
Original summary in English
Summary by Sourcery
Bug Fixes: