fix: reduce MCP server status polling frequency#7399
Merged
RC-CHN merged 1 commit intoAstrBotDevs:masterfrom Apr 7, 2026
Merged
fix: reduce MCP server status polling frequency#7399RC-CHN merged 1 commit intoAstrBotDevs:masterfrom
RC-CHN merged 1 commit intoAstrBotDevs:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider extracting the
30000polling interval into a named constant (or config) so it’s easier to tune and keep consistent with any other polling logic in the app. - Since the tab content is now controlled via
v-if, double‑check that any state that should persist across tab switches is not unintentionally reset on each remount ofMcpServersSectionand other tab components.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the `30000` polling interval into a named constant (or config) so it’s easier to tune and keep consistent with any other polling logic in the app.
- Since the tab content is now controlled via `v-if`, double‑check that any state that should persist across tab switches is not unintentionally reset on each remount of `McpServersSection` and other tab components.
## Individual Comments
### Comment 1
<location path="dashboard/src/views/ExtensionPage.vue" line_range="165-168" />
<code_context>
<!-- 指令面板标签页内容 -->
- <v-tab-item v-show="activeTab === 'components'">
+ <v-tab-item v-if="activeTab === 'components'">
<div class="mb-4 pt-4 pb-4">
<div class="d-flex align-center flex-wrap" style="gap: 12px">
</code_context>
<issue_to_address>
**question (bug_risk):** Switching from v-show to v-if changes lifecycle behavior and may reset internal state on each tab switch.
Any internal state within these tab contents (e.g., scroll position, unsaved form data, expanded panels) will now be lost on each tab change. If some tabs need to preserve state, keep those sections on `v-show`, or lift the persistent state into a parent component that isn’t conditionally rendered.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Comment on lines
+165
to
168
| <v-tab-item v-if="activeTab === 'components'"> | ||
| <div class="mb-4 pt-4 pb-4"> | ||
| <div class="d-flex align-center flex-wrap" style="gap: 12px"> | ||
| <h2 class="text-h2 mb-0">{{ tm("tabs.handlersOperation") }}</h2> |
Contributor
There was a problem hiding this comment.
question (bug_risk): Switching from v-show to v-if changes lifecycle behavior and may reset internal state on each tab switch.
Any internal state within these tab contents (e.g., scroll position, unsaved form data, expanded panels) will now be lost on each tab change. If some tabs need to preserve state, keep those sections on v-show, or lift the persistent state into a parent component that isn’t conditionally rendered.
RC-CHN
approved these changes
Apr 7, 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.
Modifications / 改动点
优化 MCP 服务器列表的状态轮询逻辑。原先 5 秒一次的硬编码轮询过于频繁,且在组件未激活时依然运行。本次改动延长了轮询间隔,并增加了页面可见性检测,以减少不必要的网络请求。
核心改动:
修改
McpServersSection.vue中的定时刷新逻辑:关联 Issue: #7347
修改文件:
Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Reduce unnecessary work and network load by only rendering the active extension tabs and slowing down MCP server status polling.
Enhancements: