Repository navigation
fix(web): 配置向导按命令找正在运行的 key db 任务,密钥存好后由 useProfiles 重读档案 - #1142
Merged
Merged
Conversation
数据库密钥一步不再把任务 id 存在自己的状态里,而是从共享的任务列表里找未结束的 key db --save:换步骤或关掉向导再回来,仍显示进度和「取消」,不会再排上第二个任务。 key db --save / key image --save 任务成功后由 useProfiles 重读档案,向导关着也会刷新。 fixed #1138 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
做了什么
配置向导「数据库密钥」一步的任务不再跟着组件卸载丢失(fixed https://github.com/334456777/WeFlow/issues/1138):
SetupWizard.tsx的KeyStep不再把任务 id 放在自己的useState里,而是从共享的任务列表(useJobs)里找未结束的key db --save任务。换到别的步骤、关掉向导再回来,仍显示进度(排队中 / 微信里要做的事)和「取消」,「获取数据库密钥 / 重新获取」按钮不出现,所以不会再排上第二个任务。开始请求在途时按钮禁用,防止连点。useProfiles:它接收任务列表,看到一个key db --save或key image --save任务从未结束变为succeeded时调用reload()。App把jobs.jobs传进去,所以向导关着、停在别的步骤时,密钥存好后档案也会刷新,「下一步」随即可用。KeyStep不再自己调onSaved()(手动填写密钥保存后仍调用)。api/jobs.ts新增commandName(命令行里去掉weflow和参数后的前两个词,describeCommand也改用它),api/setup.ts新增savedKey(job)判断任务保存的是哪种密钥。src/mock)原本就在页面里按时间运行key db任务、成功后把密钥写进档案,行为不用改;补了一个测试,确认示例任务的命令行能被savedKey认出、成功后档案里有密钥。ImageStep的key image --save是直接请求,不是任务,卸载后onSaved仍会被调用,保持现状。怎么验证的
bun run check全部通过(契约、英文、JSDoc、类型检查、374 个测试、构建)。没有新增界面文字。SetupWizard.test.tsx):POST /key/db只发了一次;/api/config/profiles被重读一次,再打开向导,数据库密钥一步显示「当前档案已有数据库密钥。」,「下一步」可用。SetupWizard.tsx、useProfiles.ts上都失败。mock/server.test.ts:示例的key db --save任务运行中档案没有密钥,成功后有。用户可见的变化
requests.test.tsx未改动且通过)。🤖 Generated with Claude Code