Repository navigation
fix: 百智云每日积分误判 + 浏览器登录候选顺序(0.2.46) - #14
Merged
Merged
Conversation
- 百智云每日积分(#13):`claimed:false` 不再一律当「今日已领取」,按 `captcha_required` / `captcha` 对象 → 回读钱包(dailyClaimed 或 temporary 正差额)→ failed 三档判定;三档各报真话。误报成「已领取」会让宿主当天 不再重试,额度卡片也永远不出「每日积分」那一行。 - 浏览器登录(#7):优先系统默认浏览器(`UrlAssociations\http\UserChoice` 的 ProgId),夸克 / UC 这类会自己回收 CDP 目标的浏览器排最后;目标丢失时 报可行动文案(换用 Edge 或 Chrome),不再误导成「窗口被关掉了」。 - 测试:`node --test` 427/427 通过;`node scripts/check.mjs` 49/49 通过; `node scripts/check-maintenance.mjs` 仅「0.2.46 没有 tag」一条失败(发布前预期)。 Co-authored-by: NaturePorter <NaturePorter@users.noreply.github.com>
MYCF711
force-pushed
the
fix/issues-13-7
branch
from
November 19, 2026 07:37
fbade5f to
02c4a7e
Compare
This was referenced Nov 19, 2026
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.
概要
0.2.46 修两处用户可感知的问题:百智云「每日积分」把「要验证码」误报成「今日已领取」(#13);受控浏览器登录优先选中夸克 / UC,导致 CDP 目标被浏览器自己回收(#7)。
除这两处实现与配套测试外,只有
package.json的版本号与CHANGELOG.md的 0.2.46 一节。修复一:百智云每日积分把「要验证码」误报成「今日已领取」(#13)
现象
点「领取每日积分」后插件回「今日已领取」,可钱包里并没有这笔积分。宿主把当天记成已完成,于是当天不再重试,额度卡片上「每日积分」那一行也永远不出现,要等第二天才恢复。
根因
上游要求人机验证时,领取接口回的是
claimed:false,同时带captcha_required: true与captcha对象(点选图片验证码)。原实现把claimed === false一律翻译成「今日已领取」—— 那是给并发幂等准备的判断。结果「要验证码」「并发幂等已领取」「上游根本没发」三种完全不同的结局被压成了同一种。判据
captcha_required === true,或报文里带captcha对象 ⇒kind: "captcha",文案指引到控制台手动领取;不复读钱包、不重发领取;daily_claimed为真,或temporary_credit_cents比领取前有正差额 ⇒kind: "already-claimed"(并发幂等,保持原文案「今日已领取」);kind: "failed",宿主当天仍可重试,不再谎报已领取。checkin的 outcome 相应为captcha/claimed/failed,不再一律claimed。修复二:浏览器登录不再优先选夸克(#7)
现象
机器上装了夸克 / UC 时,点「浏览器登录」先起夸克。窗口明明开着,约 10 秒后 CDP 连接被断,界面报「受控浏览器窗口被关掉了」—— 用户没关窗口,反复重试都卡在同一步。
根因
两件事叠在一起:
App Paths命中优先排序,夸克 / UC 只要注册过就排在 Chrome / Edge 前面,完全没有看系统默认浏览器;/json/list,并回收插件已经连上的 page 目标。原实现把「WS 断了」一律当成「窗口被关掉了」,文案把用户引向错误的方向。判据
HKCU\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice的ProgId再映射到 exe(MSEdgeHTM→msedge.exe、ChromeHTML→chrome.exe、BraveHTML→brave.exe…);默认是 Firefox 时按「没有默认」处理(Firefox 不支持 CDP)。排序与 ProgId 映射都是纯函数,注册表与存在性探测可注入。quark.exe/ucbrowser.exe一律排最后:即使被设为系统默认也不进第一梯队,只有没有别的可用候选时才退回它们。门禁结果
node scripts/check.mjsnode --testnode scripts/check-maintenance.mjsnode scripts/privacy-scan.mjs --staged新增的离线单测:
tests/baizhi.test.mjs(claimed:false的 captcha / 并发幂等 / failed 三档与调用顺序)和tests/browser-candidates.test.mjs(ProgId 映射、候选排序、默认浏览器不在候选表时补位、夸克 / UC 殿后、目标丢失文案、端口探活)。全部注入假实现,不读真注册表、不启动浏览器。版本
0.2.45→0.2.46。本 PR 不打 tag、不发 npm、不发 Release —— 合并后按发布流程单独走。