fix(desktop): 降低工作流链接生成请求风暴#24
Merged
Merged
Conversation
Merged
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 本地验证自有工作流保存时,创建工作流弹窗会在输入过程中持续调用
/recipes/encode生成分享链接。当前现场出现 goosed 仍监听端口但所有请求超时的状态。问题
CreateEditRecipeModal在每次表单字段变化后立即发起generateDeepLink(),没有防抖,也不会取消上一轮请求。长文本输入时会连续堆积/recipes/encode请求,可能把 renderer 到 goosed 的同源连接占满,随后保存、读取配置、列表等请求都表现为Failed to fetch或超时。根因
分享链接生成是辅助展示功能,不应该在用户每次输入时无节制地并发请求后端。现有实现缺少防抖和取消机制。
方案
encodeRecipe/generateDeepLink支持传入AbortSignalError generating deeplink验收
pnpm -C ui/desktop exec eslint src/recipe/index.ts src/components/recipes/CreateEditRecipeModal.tsx --max-warnings 0 --no-warn-ignored通过git diff --check通过不解决什么