server: POST /api/config/reload discards a dropped session-trial config and loads a phantom CWD-resolved .profiles
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 routes/config.py 中 _config_response 和 reload_config_endpoint 附近的代码,然后对比 issue 中提到的 /save 检查和 GET /content 的行为。检查 server/state.py 中相关的状态辅助函数,以及涵盖 reload 和会话 trial 的测试。完成标准是:重新加载 trial 不会丢弃其内容,且 trial 响应不会报告虚构的配置路径。
由索引模型根据 Issue 内容生成。
描述
Problem
After POST /load-content (drag-drop), state.session_trial = True and no real path exists. But _config_response records a phantom path on every call (routes/config.py:93):
state.config_path = config_path
where active_config_path() falls back to find_config_file() or Path.cwd() / PRIMARY_CONFIG_NAME (server/state.py:67-69). POST /reload has no session-trial guard (unlike /save, which gates on has_disk_path() at config.py:442):
# routes/config.py:323-357
config_path = state.active_config_path() # resolves the phantom
…
state.session_trial = False
state.trial_content = None
It loads that unrelated file, clears the trial state, and the user's dropped, possibly-unsaved draft is discarded — replaced by whatever .profiles sits in the CWD subtree (or by defaults if none loads: ConfigReader.load() silently falls back, reader.py:156-170).
The UI exposes this unconditionally: Ctrl+R (App.tsx:1299-1303) and the HeaderBar reload button (App.tsx:1571) call handleReloadConfig() with no trial check.
Suggested fix
- In
reload_config_endpoint, refuse trials exactly like/savedoes:if not has_disk_path(state): raise HTTPException(400, "Cannot reload: the active configuration is a session trial…"). - Stop
_config_responsefrom mutatingstate.config_path/cfg.config_pathwhenstate.session_trialis True. - Bonus:
GET /contentalready returnsconfig_path: Nonefor trials (config.py:390-396) —_config_responseshould do the same so the UI can tell it is on a trial after a page refresh (related: #127-GET-mutation issue).
- 主要语言
- Python
- 星标
- 1
- 派生
- 1
- 平均合并
- 4 小时 46 分钟
- 30 天内合并 PR
- 55
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
falbany/ProFiles 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
falbany/ProFiles#187 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug frontend
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug frontend
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
bug frontend
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
相似的 Issue
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 86/100
aws-samples/sample-spec-driven-presentation-maker#648 ·
维护者通常 1 天内回复
-
firestore: enable live window.yaml pipeline system tests once add_window_fields is in production未关闭
难度 1/5 1 小时以内 新手友好度 64/100
googleapis/google-cloud-python#19115 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Feyisara2108/stellargive#1377 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复