Repository navigation
fix(qoder): 签到 skip 原因可见 + 续期缺 token 时保留原值 - #327
Open
caigee-cmd wants to merge 3 commits into
Open
caigee-cmd wants to merge 3 commits into
caigee-cmd wants to merge 3 commits into
Conversation
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.
Refs #323
背景
CN 用户反馈只在登录当天签到成功,之后每天都显示"签到活动未开放"或没有加积分(#229、#248 也是同类问题)。没有真实 CN 账号,本 PR 只修代码层面能确认的问题,并把上游的真实返回暴露出来,方便定位根因。
改动
internal/providers/qoder/checkin.go,Bridge.Checkin)skipped / 签到活动未开放,不写任何日志。旧版 worker(worker/src/checkin.mjs)在同样情况下会打印summary,迁移到 Go 时这段丢了。[qoder-checkin] region=... count=... summary=ACTION:STATUS,...日志。签到结果消息也会写成"上游未返回可领取积分的签到活动(活动数 N:…)"或"签到活动当前不可领取(…)"。这条消息会经RecordCheckin存成last_checkin_msg,账号卡片的签到 Tooltip 本来就会显示它,所以前端不用改。internal/providers/qoder/bridge.go,applyJobToken)RefreshJobToken的响应如果缺securityOauthToken或refreshToken,内存里的值会被清成空串。之后签到和额度请求会拿不到 bearer,下一次续期也会失败。测试
bridge_token_test.go,覆盖两种情况:续期响应缺 token 时保留旧值;带了新 token 时替换。TestBridgeCheckinNoClaimable,新增"只有非积分活动""积分活动不可领取"两个用例,并断言新的消息内容。go test ./...全部通过。未改动(需要更多信息)
skipped在调度上算当天的终态(TestCheckinSchedule),本 PR 没有改这个策略。quota usage相关的 WARN 日志才能定位。