fix(api): refresh image export cache when larger file is available#959
Merged
xunchahaha merged 1 commit intoMay 26, 2026
Merged
Conversation
Collaborator
|
在 electron/services/httpService.ts:1546 这一行: 这里使用了 imageBuffer,但在这个代码分支中,我们只有 imagePath 变量(原代码是 fs.copyFileSync(imagePath, fullPath))。这会导致运行时 ReferenceError。 |
Contributor
Author
|
@xunchahaha 如图,可以发现展开代码后,此处调用 writeFileIfLarger 之前已经定义了 imageBuffer: 所以这里不会出现 ReferenceError。应该是 GitHub 折叠 diff 时只显示了调用行的问题。
|
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.


Fixes #949
What changed
Update HTTP API image export cache logic so a later larger image can overwrite an existing smaller cached image.
Why
Previously, if the file already existed, WeFlow skipped writing it, so an exported thumbnail could keep blocking the later high-resolution image.
Testing
git diff --check