Repository navigation
[bugfix] Windows 重命名撞名返回 409 + 清理生成轮询的 abort 监听器 - #2
Closed
kunkunblueberry wants to merge 1 commit into
Closed
kunkunblueberry wants to merge 1 commit into
kunkunblueberry wants to merge 1 commit into
Conversation
…ners - rename_path on Windows let a raw FileExistsError escape when the target project directory already existed, surfacing as a 500 instead of the documented conflict error; the POSIX paths already translated it. - the generation poll helper kept its abort listener registered after resolving, so a two-minute video generation accumulated one listener per 3-second wait on the same run signal; both exits now remove it. Both failures were caught by existing suites: the rename case turned test_rename_without_noreplace_support_still_never_replaces red, and the listener leak is covered by the new backendWait test.
Collaborator
Author
|
先撤下,等分支策略定稿后再统一提;改动保留在 fix/rename-and-poll-listener 分支上。 |
5 tasks done
5 tasks
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.
修了什么
代码审查(rea @ f74982c)发现的两个确定性问题,各一处小改:
1. Windows 下重命名项目撞名直接 500(core,main 同样存在)
packages/core/src/museshow/infrastructure/rename.py的 Windows 分支直接os.rename,目标目录已存在时抛出裸FileExistsError,API 变 500。POSIX 路径都会转成ProjectError("目标目录已存在,未覆盖任何文件。", 409),Windows 分支漏了同样的翻译。test_rename_without_noreplace_support_still_never_replaces[False/True]修复前为红,修复后转绿。core在 main 与 rea 是同一份,建议合并后 cherry-pick 到 main。2. 生成轮询的 abort 监听器泄漏(web)
src/backend/generation.ts的wait():定时器正常 resolve 时 abort 监听器不移除,一次 2 分钟的视频生成(3 秒一轮询)会在同一个运行期 signal 上累积约 40 个监听器。现在 resolve 和 reject 两条路径都会移除监听器。tests/backendWait.test.ts:断言等待结束后 signal 上不再残留 abort 监听器、中途取消能正确 reject。验证
node --test tests/*.test.ts:166/166 通过(含新增 2 条)pytest tests:522 通过(修复前 520;rename 两条由红转绿)未包含(后续可拆)
followServiceTasks遇到并发同步会提前退出