-
Notifications
You must be signed in to change notification settings - Fork 581
fix(image-viewer): clean up animation timer on unmount to prevent unhandled errors during test runs #6203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
3
commits into
develop
Choose a base branch
from
copilot/fix-unhandled-error-in-tests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+12
−1
Conversation
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
Collaborator
|
@copilot 继续工作 |
Copilot stopped work on behalf of
liweijie0812 due to an error
November 28, 2025 14:10
Collaborator
|
@copilot 继续 |
…handled errors Co-authored-by: liweijie0812 <10710889+liweijie0812@users.noreply.github.com>
Contributor
Author
Fixed in commit e2cde96. The issue was that the |
Copilot
AI
changed the title
[WIP] Fix unhandled errors during test runs
fix(image-viewer): clean up animation timer on unmount to prevent unhandled errors during test runs
Nov 28, 2025
Copilot finished work on behalf of
liweijie0812
November 28, 2025 16:17
commit: |
liweijie0812
approved these changes
Nov 29, 2025
Collaborator
TDesign Component Site Preview Open
|
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.

🤔 这个 PR 的性质是?
🔗 相关 Issue
测试运行时偶发
NotFoundError: The child can not be found in the parent错误,导致 CI 失败。💡 需求背景和解决方案
问题描述:
在运行 upload 组件测试时,偶尔会出现
NotFoundError: The child can not be found in the parent错误。这个错误在测试环境销毁后被捕获,表明有未完成的异步操作。根本原因:
ImageViewer组件在packages/components/image-viewer/image-viewer.tsx中使用了一个 200ms 的setTimeout来处理可见性变化时的动画。当测试用例通过document.querySelectorAll('.t-image-viewer').forEach((node) => node.remove())手动移除 DOM 节点时,Vue 组件没有被正确卸载,导致定时器回调在测试环境销毁后仍然执行,尝试更新已移除组件的响应式状态。解决方案:
在
ImageViewer组件中添加onBeforeUnmount生命周期钩子,在组件卸载时清除动画定时器,防止内存泄漏和未处理的错误。📝 更新日志
tdesign-vue-next
@tdesign-vue-next/chat
@tdesign-vue-next/auto-import-resolver
☑️ 请求合并前的自查清单
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.