fix(desktop): 稳定工作流信任哈希#25
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.
背景
3F 本地验证确认:#24 后创建弹窗不再报
Error generating deeplink,保存自有工作流成功,但保存后运行仍弹“新工作流警告”。问题
同一个自有工作流,保存时记录的 hash 和从 YAML/list 读回后的运行时 recipe hash 不一致。
根因
信任 hash 使用
JSON.stringify(recipe)。前端保存对象和 Rust 后端从 YAML 读回来的对象字段顺序/形态可能不同,导致语义相同的工作流 hash 不稳定。方案
JSON.stringifyrecipeHash.ts的读取/写入都使用稳定 hashseedDefaultRecipes()的内置工作流预信任 hash 也使用同一 helper验收
pnpm -C ui/desktop exec vitest run src/utils/stableRecipeHash.test.ts通过pnpm -C ui/desktop exec eslint src/utils/stableRecipeHash.ts src/utils/stableRecipeHash.test.ts src/utils/recipeHash.ts src/main.ts --max-warnings 0 --no-warn-ignored通过git diff --check通过