Repository navigation
feat(login-health): 登录态定时巡检与失效系统通知(任务书 A-1) - #87
Merged
Merged
Conversation
- 新增:loginHealthCheck 服务,默认 30 分钟一轮巡检账号树全部账号登录态,首轮延迟 1 分钟避开启动高峰,仅 GUI 模式启动 - 新增:失效告警仅在 valid→invalid 转变时发一次系统通知(平台+账号名,点击聚焦主窗口),恢复只记录不通知,同一失效不重复轰炸 - 新增:状态机防抖动,明确未登录与探测失败同等计次,连续 2 轮失败才判 invalid;发布任务在跑的账号本轮跳过 - 新增:健康状态持久化 userData/data/loginHealth.json(tmp+rename 原子写),IPC login-health:get 供 renderer 查询 - 优化:巡检复用 getCookie 的 cli accounts 子进程读磁盘真实登录态(失败回退 runAccountsCli.probeLogin 进程内探测),不新造判定规则 - 优化:puppeteerFile 新增只读查询 isPublishTaskActiveForPartition(含任务队列 hasTaskForPartition),不改任何任务行为 - 测试:test-login-health-check 覆盖状态机全部分支与持久化读写,登记进 scripts/tests.json
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.
任务书
docs/roadmap-capability-ui.mdA-1(P0):消灭「发布时才发现掉登录」的痛点。功能
valid→invalid转变时发一次系统通知(平台 + 账号,点击聚焦主窗口);恢复不通知只记录;同一失效不重复轰炸consecutiveFails,连续 2 轮才判 invalid;发布中的账号本轮跳过(新增只读查询isPublishTaskActiveForPartition,不改任务行为)userData/data/loginHealth.json(tmp+rename 原子写,损坏容错),含 lastStatus/lastCheckedAt/lastValidAt/consecutiveFails/lastReasonlogin-health:get返回全量健康状态(为 P1 账号管理页健康筛选 chip 备数据)复用而非新造
getCookie.js的fetchFreshLoginRows()(cli accounts --json子进程读磁盘真实登录态,规避进程内 session 内存副本陈旧误报,含视频号 auth_data 真实探测)runAccountsCli.probeLogin()(与 getCookie 自身回退同源)测试
scripts/test-login-health-check.js(已登记scripts/tests.json):转变通知一次 / 不轰炸 / 恢复不通知 / 连续 2 轮判失效 / 探测失败同等计次 / 发布中跳过 / 持久化读写与损坏容错 / 队列只读查询npm run build:dir通过遗留(不阻塞)
cli accounts一次探测全部账号,发布中账号的「跳过」在状态应用层(cookie 只读探测仍会执行,与手工cli accounts等价);如需严格零触碰,后续给cli accounts加排除参数