fix: 修复多个问题 — 错误处理、宽限期、邮件通知、法人代表同步#479
Conversation
1. 修复 "doc doesn't exist" 错误未正确转换为领域错误的问题 - toModelError 中添加对 ErrorResourceNotFound 的判断 - FindCLAs 中捕获资源不存在错误并转换为 ErrorCodeLinkNotExists 2. 宽限期默认改为 2 年(730天),每季度(90天)发送邮件通知 3. 修复邮件通知 URL 路径问题,移除多余的 sign/ 前缀 4. 修复 signing/watch/config_test.go 和 notify_corp_admin_test.go 编译错误 5. 修复 UpdateRepresentative 未同步更新 cs.Admin 和 User 表的 BUG - 修改法人代表邮箱后,同步更新管理员登录账号信息 - 同步更新 User 表中的 email 和 account 字段 - 确保修改后可用新邮箱登录和重置密码
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Welcome To opensourceways CommunityHey @JavaPythonAIForBAT , thanks for your contribution to the community. Bot Usage ManualI'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. Contact GuideIf you have any questions, please contact the SIG: infratructure , |
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Linking Issue Notice@JavaPythonAIForBAT , the pull request must be linked to at least one issue. |
|
|||||||||||||||
|
/retest |
|
|||||||||||||||
1. 修复企业管理员登录URL缺少 /corporation-manager-login/ 前缀 - URLOfCLAPlatform 改为 rootURL() + /corporation-manager-login/ + linkId - 例如: https://clasign.osinfra.cn/corporation-manager-login/{linkId} 2. 修复个人签署更新URL缺少 /sign-cla/ 前缀 - SignCLAURL 改为 rootURL() + /sign-cla/ + linkId + /individual-update?email=xxx - 例如: https://clasign.osinfra.cn/sign-cla/{linkId}/individual-update?email=xxx 3. 恢复 IndividualSigned.Status 字段并通过adapter传递 - API响应中恢复 status 字段("not_signed" | "valid" | "expired")
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
UpdateCLA 的 $set 操作只更新了 updated_at,没有更新 url/lang/type 字段, 导致更新 CLA PDF 后数据库中仍保留旧 URL,页面显示的也是旧 PDF。 修复:$set 操作包含 url、lang、type、updated_at 四个字段。 同时移除对 claDO 无意义的 fieldCLANum 字段更新(cla_num 是 link 级别字段)。
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
signed + version_matched 已完整覆盖所有签署状态: - signed=false, version_matched=false → 未签署 - signed=true, version_matched=false → 签署过但已过期 - signed=true, version_matched=true → 签署过且在有效期内 status 字段冗余,移除。
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
|
|||||||||||||||
ContainsCla 只查内存缓存,当缓存因服务未重启等原因落后于数据库时, AgreeNewCLA 会错误地返回 "cla not exists"。 修复:缓存未命中时查询数据库,并将结果回填缓存。
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
与 ContainsCla 同样的问题:只查内存缓存,缓存未命中时返回空值, 导致 Check 接口的 isLatestClaVersion 误判、FindDiffCLAFile 对新签署 用户也生成 diff 文件。 修复:提取 fillCacheFromDB 公共方法,三个方法缓存未命中时都兜底查 DB。
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
UpdateClaId 只更新了 cla_id,没有清除 cla_notify。导致企业管理员 同意新协议后,数据库中 cla_notify 仍为旧值,前端可能因此仍认为 有待同意项,展示旧版PDF而非新版。 修复:UpdateClaId 同时将 cla_notify 置空,与个人 SaveNewCLA 行为一致。
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
- UpdateCLA 的 操作补充 fieldId,确保 clas 中的 id 正确更新为新 CLA id - 企业管理员通知支持每90天重复提醒,与个人保持一致 - corpSigningDO 增加 cla_notify_count/cla_notify_time 字段进行持久化 - 补充 ErrorCodeCorpSigningCLAIsLatest 和 ErrorCodeIndividualSigningCLAIsLatest 的错误码映射
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
- CLA 更新成功后调用 SetPendingCLAForLink,将所有企业签署的 cla_notify 设置为新 CLA id,watcher 检测后立即发送通知 - SetPendingCLAForLink 同步重置 cla_notify_count/time,确保 第一次通知不被 90 天阈值误跳过 - Redis 缓存层补齐 ClaNotifyCount/ClaNotifyTime 字段
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
旧数据 cla_notify_count/time 为 0,上线后会被误判为未通知而立即发邮件。 新增兼容逻辑:当 cla_notify 已指向最新 CLA 但 count/time 为 0 时, 视为旧系统已通知过一次,初始化 count=1、time=now,跳过本次发送, 从当前时间起 90 天后才发送下次提醒。
|
|||||||||||||||
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
- watch 包新增 TriggerNotify() 函数,向企业/个人 watcher 发送即时触发信号 - notifyCorpAdmin/notifyIndividualSigner 增加对触发通道的监听 - CLA 更新成功后调用 TriggerNotify(),实现秒级通知 更新后通知延迟: 企业管理员: 从 ≤20分钟 → 立即可达 个人用户: 从 ≤24小时 → 立即可达
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
- 企业和个人的定时扫描间隔统一从 20分钟/24小时 改为每日凌晨 0:00 - 首次启动自动计算到下一个午夜的时间 - CLA 更新后仍通过 TriggerNotify() 立即触发,不受午夜限制 - 触发后定时器也重置为下一个午夜,确保日常扫描始终在零点
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
1. 移除错误的存量兼容检查,避免 CLA 更新后首次通知被跳过 SetPendingCLAForLink 设置 count=0 后,兼容检查误判为已通知 2. isIndividualSigningLatest 默认值从 true 改为 false,与 isCorpSigningLatest 一致 3. SetPendingCLAForLink 失败不再阻断 CLA 更新成功响应,改为仅记录日志 4. 定时器重置统一为 nextNoonOrMidnight,避免时钟漂移
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
- NotifyBatchSize 配置项,默认 500,控制每轮定时扫描最大发送数 - handleCorpSigning/handleIndividualSigning 返回 bool 表示是否发送 - handleNotifyJob/handleIndividualNotifyJob 到达批次上限后停止本轮 - 下一轮扫描自动续上:已发送的跳过,未发送的继续
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
- 新增 enabled_community_orgs 白名单配置,仅对名单内社区发送通知 列表为空时默认通知全部社区(逐渐开放,可控上线) - 定时扫描间隔变为可配置: 配置 notify_corp_admin_interval/notify_individual_interval != 86400 → 直接使用该间隔(测试环境可设为60秒快速验证) 配置 == 86400 → 生产模式:首次对齐中午/凌晨,后续每12小时一次 - handleNotifyJob/handleIndividualNotifyJob 增加社区过滤逻辑
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
修改内容
1. 修复 "doc doesn't exist" 错误未正确转换
toModelError中添加对ErrorResourceNotFound的判断,映射为ErrNoLinkFindCLAs中捕获资源不存在错误并转换为ErrorCodeLinkNotExists2. 宽限期默认改为 2 年,每季度发送邮件通知
3. 修复邮件通知 URL 路径问题
sign/前缀4. 修复测试文件编译错误
signing/watch/config_test.gosigning/watch/notify_corp_admin_test.go5. 修复 UpdateRepresentative 未同步更新 cs.Admin 和 User 表的 BUG
cs.Admin.Representative)User表中的email和account字段HasPDF不会被清除)Issue
resolve https://github.com/opensourceways/backlog/pull/909