Skip to content

fix(GeneralInvite): invite_again 勾选框 interval 改为 3 - #1980

Open
allesgutefy wants to merge 1 commit into
runhey:devfrom
allesgutefy:fix/invite-again-interval
Open

allesgutefy wants to merge 1 commit into
runhey:devfrom
allesgutefy:fix/invite-again-interval

Conversation

@allesgutefy

@allesgutefy allesgutefy commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

修复 invite_again 中勾选框识别的时序问题

问题背景

check_and_invite 中 I_UI_UNCHECK 的 interval 已改为 3(PR #1930),但 invite_again 方法中仍然是 interval=1,存在同样的时序风险:点击勾选框后 UI 未及时刷新,导致循环重复点击或跳过勾选步骤。

修复内容

tasks/Component/GeneralInvite/general_invite.py → invite_again 方法:

  • I_UI_UNCHECK 的 appear_then_click 参数由 interval=1 改为 interval=3

与 check_and_invite 中已合并的修复保持一致。

验证

本地实测 interval=3 可解决勾选弹窗识别不及时的问题。

Fixes #1881

Sourcery 摘要

错误修复:

  • 增加“再次邀请”复选框的检测间隔,避免过时的界面状态导致重复点击或跳过邀请步骤。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Increase the invite-again checkbox detection interval to prevent stale UI state from causing repeated clicks or skipped invitation steps.

Fixes occasional checkbox recognition issue in the re-invite dialog,
matching the same fix already applied in check_and_invite.

Fixes runhey#1881

@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.

嗨——我发现了 1 个问题

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tasks/Component/GeneralInvite/general_invite.py" line_range="510" />
<code_context>
                 if self.appear(self.I_UI_CHECK):
                     break
-                if self.appear_then_click(self.I_UI_UNCHECK, interval=1):
+                if self.appear_then_click(self.I_UI_UNCHECK, interval=3):
                     continue
         else:
</code_context>
<issue_to_address>
**Default invitation remains enabled**

When `default_invite` is false and the dialog takes more than one second to reflect a checkbox click, the `default_invite=False` branch calls `appear_then_click(self.I_UI_CHECK, interval=1)`, so a stale checked image is clicked again before the UI updates and the checkbox ends in the wrong state.

Increase the interval for the `I_UI_CHECK` click in the `default_invite=False` branch so the UI can update before it is checked again.
</issue_to_address>

Sourcery 评估

待批准。 请先处理 1 条发现。

阻塞性发现:tasks/Component/GeneralInvite/general_invite.py:510


Sourcery 对开源项目免费——如果您喜欢我们的评审,请考虑分享 ✨
Original comment in English

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tasks/Component/GeneralInvite/general_invite.py" line_range="510" />
<code_context>
                 if self.appear(self.I_UI_CHECK):
                     break
-                if self.appear_then_click(self.I_UI_UNCHECK, interval=1):
+                if self.appear_then_click(self.I_UI_UNCHECK, interval=3):
                     continue
         else:
</code_context>
<issue_to_address>
**Default invitation remains enabled**

When `default_invite` is false and the dialog takes more than one second to reflect a checkbox click, the `default_invite=False` branch calls `appear_then_click(self.I_UI_CHECK, interval=1)`, so a stale checked image is clicked again before the UI updates and the checkbox ends in the wrong state.

Increase the interval for the `I_UI_CHECK` click in the `default_invite=False` branch so the UI can update before it is checked again.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: tasks/Component/GeneralInvite/general_invite.py:510


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

if self.appear(self.I_UI_CHECK):
break
if self.appear_then_click(self.I_UI_UNCHECK, interval=1):
if self.appear_then_click(self.I_UI_UNCHECK, interval=3):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 中等 · 默认邀请仍处于启用状态

当 default_invite 为 false,且对话框需要超过一秒才会反映复选框点击操作时,default_invite=False 分支会调用 appear_then_click(self.I_UI_CHECK, interval=1),因此在界面更新之前,过时的已勾选图像会再次被点击,导致复选框最终处于错误状态。

请增大 default_invite=False 分支中 I_UI_CHECK 点击操作的间隔,以便界面有时间更新后再进行下一次检查。

面向 AI 代理的提示
在 `tasks/Component/GeneralInvite/general_invite.py` 第 510 行:

**默认邀请仍处于启用状态**

当 `default_invite` 为 false,且对话框需要超过一秒才会反映复选框点击操作时,`default_invite=False` 分支会调用 `appear_then_click(self.I_UI_CHECK, interval=1)`,因此在界面更新之前,过时的已勾选图像会再次被点击,导致复选框最终处于错误状态。

请增大 `default_invite=False` 分支中 `I_UI_CHECK` 点击操作的间隔,以便界面有时间更新后再进行下一次检查。
Original comment in English

🟡 Medium · Default invitation remains enabled

When default_invite is false and the dialog takes more than one second to reflect a checkbox click, the default_invite=False branch calls appear_then_click(self.I_UI_CHECK, interval=1), so a stale checked image is clicked again before the UI updates and the checkbox ends in the wrong state.

Increase the interval for the I_UI_CHECK click in the default_invite=False branch so the UI can update before it is checked again.

Prompt for AI agents
In `tasks/Component/GeneralInvite/general_invite.py` at line 510:

**Default invitation remains enabled**

When `default_invite` is false and the dialog takes more than one second to reflect a checkbox click, the `default_invite=False` branch calls `appear_then_click(self.I_UI_CHECK, interval=1)`, so a stale checked image is clicked again before the UI updates and the checkbox ends in the wrong state.

Increase the interval for the `I_UI_CHECK` click in the `default_invite=False` branch so the UI can update before it is checked again.

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