Repository navigation
fix(previewer): ignore pending image callbacks after destroy - #1871
Merged
sunsonliu merged 1 commit intoSep 1, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 6891165 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
cherry-markdown
@cherry-markdown/miniprogram
commit: |
Collaborator
🔌 VSCode Plugin 构建产物
|
Collaborator
Collaborator
🌐 Playground 预览 |
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.
问题背景
LazyLoadImg.destroy()会清理options、预览 DOM 和加载状态,但已经发出的图片请求仍可能在稍后触发load/error。原有异步闭包会继续访问已清理的options,从而在编辑器销毁后抛出 TypeError。Fixes #1868
修改内容
isDestroyed门禁load与error两条路径cherry-markdownpatch changeset验证
yarn lint(0 errors;仅仓库既有 warnings)yarn typecheckyarn test(128 test files,2221 tests 全部通过)yarn buildnode node_modules/es-check/index.js es5 packages/cherry-markdown/dist/cherry-markdown.jserror/unhandledrejection,且加载成功/失败业务回调均未触发本地环境说明
Windows 下执行
vp run -F cherry-markdown test:artifacts时,7 项中 6 项通过;剩余 ES5 子检查将反斜杠绝对路径传给fast-glob后无法匹配文件。对同一构建产物使用仓库相对路径执行等价es-check已通过。该差异不涉及本次源代码行为。