Fix/representative sync and errors#480
Conversation
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. |
There was a problem hiding this comment.
Code Review
This pull request introduces a fallback mechanism for formatting the CLA update time when the original update timestamp is missing or invalid. The reviewer noted a logical issue where using the current time as a fallback would cause the displayed date to shift in subsequent reminder emails, and suggested using the initial notification time as a consistent fallback instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| latestUpdateAt := latestCLA.UpdatedAt | ||
| if latestUpdateAt <= 0 { | ||
| latestUpdateAt = time.Now().Unix() | ||
| } |
There was a problem hiding this comment.
在这里使用 time.Now().Unix() 作为 latestUpdateAt 的兜底方案存在一个逻辑缺陷:
由于 latestCLA.UpdatedAt 在数据库中依然是 0(旧数据),每次执行定时任务发送提醒邮件时,latestUpdateAt 都会被重新计算为发送邮件时的当前时间。
这会导致用户在收到第一封提醒邮件时,邮件显示更新时间为 Day 1;而在收到第二封提醒邮件(如 7 天后)时,邮件显示的更新时间会变成 Day 8。这种“不断移动的更新时间”会给用户带来困惑,让他们误以为 CLA 又被更新了。
建议的解决方案
如果 latestCLA.UpdatedAt <= 0,我们可以优先使用 is.ClaNotifyTime(即首次发送通知的时间)作为兜底。如果 is.ClaNotifyTime 也为 0(说明是第一次发送),再使用 time.Now().Unix()。这样可以确保在后续的提醒邮件中,显示的更新时间保持一致。
| latestUpdateAt := latestCLA.UpdatedAt | |
| if latestUpdateAt <= 0 { | |
| latestUpdateAt = time.Now().Unix() | |
| } | |
| latestUpdateAt := latestCLA.UpdatedAt | |
| if latestUpdateAt <= 0 { | |
| if is.ClaNotifyTime > 0 { | |
| latestUpdateAt = is.ClaNotifyTime | |
| } else { | |
| latestUpdateAt = time.Now().Unix() | |
| } | |
| } |
|
|||||||||||||||
|
/lgtm |
Review Code Feedback
Tips
|
Review Code Feedback
Tips
|
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. 👍 |
|
|||||||||||||||
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. 👍 |
|
|||||||||||||||
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. 👍 |
|
|||||||||||||||
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. 👍 |
|
|||||||||||||||
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
1 similar comment
CLA Signature PassJavaPythonAIForBAT, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
|
|||||||||||||||
|
|||||||||||||||
handleNotifyJob/handleIndividualNotifyJob: 记录任务开始/结束、链接数量、扫描人数 handleCorpSigning/handleIndividualSigning: 记录跳过原因(版本相同/无匹配CLA/冷却期内) handleIndividualSigning: 记录发送成功日志 所有关键决策点均有日志输出,搜索notify即可定位
进入发送流程时记录 signed_cla/latest_cla/cla_notify/count/time 发送时记录 UpdatedAt 原始值和格式化后的日期,便于复现 1970-01-01
原 int 类型无法区分配了 0 和没配(默认 0),导致 YAML 中设 0 时 SetDefault() 用 <=0 判断又覆盖回 90。 改为 *int 后用 nil 判断:nil → 用默认 90,非 nil → 用配置值(0 也生效)
- TriggerNotify(t) 只触发对应CLA类型的扫描器,不再同时触发两边 - Update中 SetPendingCLAForLink 仅企业CLA更新时标记 - AgreeNewCLA 从签署记录获取语言,不再信任前端传入的CLAId - 新增 getEffectiveGracePeriodDays/getLatestCorpClaId/getLatestIndividualClaId 测试辅助方法 - 修复 test 默认值 1200→86400
a17e61a to
85a56aa
Compare
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. 👍 |
|
|||||||||||||||
描述
旧 CLA 数据没有 updated_at 字段 → Go 读取为 0 → time.Unix(0) = 1970-01-01。修复后当 UpdatedAt <= 0 时用当前时间兜底。
Issue
resolve https://github.com/opensourceways/backlog/pull/909