fix(desktop): 信任已保存的工作流#23
Merged
Merged
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
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 #22 处理的是内置工作流预置信任 hash 不匹配,这个 PR 补用户自己保存的工作流路径。
问题
saveRecipe()保存成功后只写入 YAML 文件,不会把当前工作流内容写入recipe_hashes。用户新建、编辑或导入后保存的工作流,第一次运行时仍会被当成未信任工作流。根因
工作流信任记录只在用户确认警告弹窗时写入;保存动作本身没有记录当前工作流 hash。
方案
保存成功后调用
window.electron.recordRecipeHash(recipeToSave),把刚保存的工作流标记为已信任。记录失败只打印警告,不影响保存成功。验收
pnpm -C ui/desktop exec eslint src/recipe/recipe_management.ts --max-warnings 0 --no-warn-ignored通过git diff --check通过pnpm -C ui/desktop run lint:check未完整通过,原因是当前本地缺少公告生成文件:../../announcements/content和../../announcements/index.json,与本 PR 改动无关