Dev - #2
Merged
Merged
Dev#2
Conversation
codename-test
added a commit
that referenced
this pull request
Sep 26, 2026
v1.3.1 改进清单 #2。 - 根因:上传/PUT 内容直接 f.save()/open('w') 落盘,先写后校验; 语法错误或 DB 冲突时旧插件文件已被覆盖丢失。 - 修复:新增 plugin_paths.atomic_upload / atomic_write_string, 先写同目录临时文件 (.tmp_*.py) + 验证(parser_loader.validate_parser / channel_loader.validate_channel:语法 + 执行 + 必含 parse/Channel), 验证通过才 os.replace() 原子替换到用户目录;失败清理临时文件、 旧插件保持不变。 - 校验委托 lazy import parser_loader / channel_loader(避免循环导入)。 - api/parsers.py 新增同 filename 存在性预检(避免覆盖已有解析器)。 - 流内容可能为 bytes(Flask FileStorage / BytesIO),写入文本临时 文件前 decode utf-8。 - 测试:新增 3 例(坏新插件不建文件、PUT 坏内容不覆盖旧解析器、 PUT 坏内容不覆盖旧通道插件)。 全量 303 passed。 Co-Authored-by: QwenPaw <[email protected]>
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.
No description provided.