Repository navigation
Conversation
Gamification_Streak_Counter_Promotion 的 last_updated 会在完成每日任务等 活动时刷新到今天,而每日任务先于签到执行,导致 v4.3.3 起签到每天被误跳过。 - resolveCheckInState 新增 trustStreak 参数(默认 false),签到前只依据 签到推广自身的 last_updated 判断是否已签 - 签到请求后零增量的到账确认仍以连胜计数器为佐证 - 更新对应测试,并新增"每日任务刷新连胜后仍签到"与"重复签到零增量被确认"用例 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
问题
升级到 v4.3.3 后,每日签到每天都会被跳过、拿不到积分,日志显示"今日已签到",但实际上当天并没有签过。
实际日志(中国区,2026-11-04,当天第一次运行):
updatedAt正好是第 3 个每日任务完成的时间(04:44:12Z,即北京时间 12:44:12),余额也只涨了每日任务的 30 分。对比 v4.3.2.4,同一个账号 10-21 到 11-03 每天签到都能拿到 5~50 分。原因
8ae6df5 在
resolveCheckInState里把Gamification_Streak_Counter_Promotion.last_updated == 今天也当作"已签到"。但连胜计数器在完成每日任务等活动时也会刷新,而Main里每日任务排在签到前面执行,所以每天签到前它都已经是今天的时间,签到就被误判跳过了。我这个账号的签到推广本身和测试 fixture 里的
recordedLegacy一样,是 hidden、时间戳停在旧日期的状态(App: 未知)。所以签到前能被判定成"已签"的唯一依据就是连胜计数器,问题因此每天必现。改动
CheckInState.ts:resolveCheckInState新增trustStreak参数,默认false。签到前只按签到推广自身的last_updated判断;判断不出来就返回unknown,照常发签到请求。DailyCheckIn.ts:签到请求后积分没有增加时,做"到账确认"仍然传trustStreak = true。这样同一天重复运行会走到"已确认今日签到,本次无新增积分",不会报错。BrowserFunc.getAppEarnablePoints用的是默认值,所以App可赚积分里的签到项也不会再因为连胜计数器被提前算成 0。代价是同一天第二次运行时会多发一次签到请求,返回 0 分。这在 v4.3.2.4 时也是如此,没有副作用。
测试
streak updated today by other activities is not a check-in/streak alone is not a check-instreak refreshed by the daily set still submits the check-in and credits it:复现上面的场景,确认会发请求并计分a repeated check-in with zero gain is confirmed by the streak record:确认重复签到不会误报失败checkInState.test.cjs+checkInFlow.test.cjs共 47 条全部通过;tsc与 eslint 通过开始每日签到 | state=unknown→每日签到完成 | type=103 | pointsGained=5另外说明:
scripts/api下 logParser / workerGaps 有 8 条用例在 V4-china 上本来就是失败的,和这个 PR 无关,我没有改。🤖 Generated with Claude Code