Skip to content

fix(okww): 返回登录等待超时时不再静默处理,显式弹出失败 - #526

Merged
AthenaHibou merged 1 commit into
AUTO-MAS-Project:devfrom
AthenaHibou:fix/okww-switch-login-wait-timeout
Sep 2, 2026
Merged

fix(okww): 返回登录等待超时时不再静默处理,显式弹出失败#526
AthenaHibou merged 1 commit into
AUTO-MAS-Project:devfrom
AthenaHibou:fix/okww-switch-login-wait-timeout

Conversation

@AthenaHibou

@AthenaHibou AthenaHibou commented Sep 2, 2026

Copy link
Copy Markdown
Member

改动摘要

  • 修复 OK-WW 账号切换在返回登录流程未能真正回到登录界面时,仍误报「已返回登录界面」并继续在错误画面上选号的问题(多用户切换的第二个账号失败且报错难以理解)。
  • 处理:返回登录后的等待超时不再被忽略,立即失败并给出明确原因,配合既有的诊断截图便于排查。
  • 已知触发场景:上一用户退出后游戏刚重新拉起、界面仍在过渡时,旧逻辑误走游戏内返回流程并误触登录。

Sourcery 摘要

确保 OK-WW 账号切换只有在确认返回登录界面后才继续,并在超时时明确中止流程。

Bug 修复:

  • 修复 OK-WW 账号切换返回登录界面超时后仍被误判成功并继续操作的问题。

功能增强:

  • 在未识别到登录界面时立即显式失败并提供明确诊断信息,避免误触登录流程并便于结合截图排查。

维护:

  • 更新应用版本信息。
Original summary in English

Summary by Sourcery

确保 OK-WW 账号切换只有在确认返回登录界面后才继续,并在超时时明确中止流程。

Bug Fixes:

  • 修复 OK-WW 账号切换返回登录界面超时后仍被误判成功并继续操作的问题。

Enhancements:

  • 在未识别到登录界面时立即显式失败并提供明确诊断信息,避免误触登录流程并便于结合截图排查。

Chores:

  • 更新应用版本信息。

@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown
审查者指南(小型 PR 中默认折叠)

审查者指南

修复 OK-WW 账号切换返回登录阶段的误成功路径:登录页 OCR 等待超时现在立即报错并提供明确提示,防止流程在过渡或游戏内错误画面继续选号,同时更新版本信息。

OK-WW 登录返回超时显式失败的时序图

sequenceDiagram
    participant Switch as _switch_to_login
    participant OCR as _wait_ocr_text
    participant Logger as on_log

    Switch->>OCR: _wait_ocr_text(hwnd, _LOGIN_PAGE_TEXTS, timeout=60)
    alt 检测到登录页
        OCR-->>Switch: 登录页文本
        Switch->>Logger: on_log(已返回登录界面)
    else 超时 60 秒
        OCR-->>Switch: None
        Switch-->>Switch: raise RuntimeError
    end
Loading

文件级变更

变更 详细信息 文件
将返回登录界面的 OCR 等待从静默超时改为显式失败,避免在错误画面上继续账号选择。
  • 检查 60 秒内是否识别到登录页特征文本;超时则抛出包含原因和人工处理建议的 RuntimeError。
  • 仅在确认识别到登录界面后记录“已返回登录界面”,保留既有诊断截图以辅助排查。
app/task/Okww/tools/account_switch.py
更新资源版本信息。
  • 调整版本元数据以反映本次修复。
res/version.json

可能关联的问题

  • #未提供:PR 让返回登录超时立即报错,避免切换失败后继续选号和执行任务,直接缓解该问题。

提示和命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以回复审查评论 @sourcery-ai issue,从该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,随时重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,随时重新生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这一功能会很有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从新的审查开始,这一功能尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

修复 OK-WW 账号切换返回登录阶段的误成功路径:登录页 OCR 等待超时现在立即报错并提供明确提示,防止流程在过渡或游戏内错误画面继续选号,同时更新版本信息。

Sequence diagram for explicit OK-WW login return timeout failure

sequenceDiagram
    participant Switch as _switch_to_login
    participant OCR as _wait_ocr_text
    participant Logger as on_log

    Switch->>OCR: _wait_ocr_text(hwnd, _LOGIN_PAGE_TEXTS, timeout=60)
    alt Login page detected
        OCR-->>Switch: login page text
        Switch->>Logger: on_log(已返回登录界面)
    else 60s timeout
        OCR-->>Switch: None
        Switch-->>Switch: raise RuntimeError
    end
Loading

File-Level Changes

Change Details Files
将返回登录界面的 OCR 等待从静默超时改为显式失败,避免在错误画面上继续账号选择。
  • 检查 60 秒内是否识别到登录页特征文本;超时则抛出包含原因和人工处理建议的 RuntimeError。
  • 仅在确认识别到登录界面后记录“已返回登录界面”,保留既有诊断截图以辅助排查。
app/task/Okww/tools/account_switch.py
更新资源版本信息。
  • 调整版本元数据以反映本次修复。
res/version.json

Possibly linked issues

  • #未提供: PR让返回登录超时立即报错,避免切换失败后继续选号和执行任务,直接缓解该问题。

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嘿——我已经审阅了你的更改,看起来很棒!

Sourcery 评估

已批准。


Sourcery 对开源项目免费——如果你喜欢我们的评审,欢迎分享 ✨
请帮助我变得更有用!请点击每条评论上的 👍 或 👎,我会利用这些反馈来改进你的评审。
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@AthenaHibou
AthenaHibou merged commit e47fc96 into AUTO-MAS-Project:dev Sep 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant