fix(console): delete_flow 版本行孤儿——SQLite 外键级联未强制,幽灵版本绕过 start 404 并砖死同 id 重建
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 36/100
Research direction
Start by reading the delete_flow handler and the SQLite connection setup, then inspect test_delete_flow_clean_200 and the tests for flow start and version creation. Reproduce the orphaned-version case after deleting a flow. Done means deletion clears its versions, starts for the deleted flow return 404 version_not_found, and recreating the same id allows PUT 1.0.0.
Written by the indexing model from the issue text.
Description
优先级 P1 · depends-on: 无(与 #307 同族不同根:#307=引用扫描窗口击穿,本单=删除级联缺失)
归属:A1 第 123 轮(状态机不变量线,gh-okguitar 轮产出;主控代提)。负控 RED 实弹树 /tmp/plaita-r123-tree,台账 duo-a-ledger「第一百二十三轮」A123-02。
Summary
DELETE /api/flows/{id} 的版本行级联只靠 SQLAlchemy ForeignKey(ondelete=CASCADE) 的 DB 级声明;SQLite 默认不强制外键,后端全程零处 PRAGMA foreign_keys=ON,而默认 db_url 就是 SQLite → 删 flow 返回 200 后版本行全部原样残留(含 published)。
后果三连(RED×4 实弹)
- 版本行残留:flow 行已删、version 行原样(status/published 标记都在);
- 幽灵执行:已删 flow 的显式版本与 latest start 均 200 入队——必败执行照常占配额,#304 的 start 具名 404(version_not_found)被整体绕过;
- 重建砖死:同 id 重建 flow 后
PUT 1.0.0撞孤儿 published 版本 409(A1 报告称砖死;force 逃生路径对该孤儿形态是否可用待修方核验)。
对照面:delete_version 单版本路径正常(GREEN,级联语义未受影响)。既有 test_delete_flow_clean_200 只断言 GET 404、从不看版本行——B 席 20 个相关用例全绿=真空盲区。此洞自 initial commit 未改过,但 #304 落地后它直接顶穿 start 侧新语义。
修法方向(供修方裁量)
- 连接层
PRAGMA foreign_keys=ON(SQLite connect 事件,一处收口),或 delete_flow显式级联删版本行(与 #303 删除协议同事务语义——勿只靠 DB 声明);生产非 SQLite(PG/MySQL 默认强制 FK)时重点在 SQLite 默认部署面- 相邻面一并裁量(同族):
delete_flow不级联 schedule 行——被删 flow 的 cron 持续产 error 行(台账 B123-03,P3;可本单收口或另立)
验收
- RED×4 翻绿:删 flow 后版本行清零;已删 flow 显式/latest start 均 404
version_not_found;同 id 重建后 PUT 1.0.0 正常 test_delete_flow_clean_200升级为断言版本行清零- 负控先红后绿证据入 docs/proofs/data/;全量守恒;landing_gate 绿
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 2h 33m
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jeffkit/plaita
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
jeffkit/plaita#307 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
jeffkit/plaita#305 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
foxglove/mcap#1907 · 1 comment ·
Maintainers usually reply within 1 day
-
namespace operations
Difficulty 1/5 Under an hour Newbie friendliness 72/100
EclipseFdn/open-vsx.org#14623 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
developmentseed/titiler-cmr#261 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
andrewyng/openworker#774 ·
Maintainers usually reply within 1 day
-
aggfuncOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
worldbank/blackmarblepy#160 ·