server: POST /api/config/reload discards a dropped session-trial config and loads a phantom CWD-resolved .profiles
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
Research direction
Read routes/config.py around _config_response and reload_config_endpoint, then compare the /save guard and GET /content behavior cited in the issue. Check the related state helpers in server/state.py and tests covering reload and session trials. Done means reloading a trial cannot discard its content, and trial responses do not report a phantom config path.
Written by the indexing model from the issue text.
Description
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).
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- Avg merge
- 4h 46m
- Merged PRs (30d)
- 55
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 falbany/ProFiles
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
falbany/ProFiles#187 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in falbany/ProFiles
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ip-tools/patzilla#219 · 2 comments ·
Maintainers usually reply within 1 day
-
EPSSClient commits to its SQLite cache once per score: a 100-CVE bulk fetch makes 101 disk flushesOpenpriority:p3 technical-debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jimmy058910/jmo-security-repo#1673 ·
Maintainers usually reply within 1 day
-
enhancement ready
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
integration: frontier_silicon
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
home-assistant/core#193176 · 2 comments ·
Maintainers usually reply within 1 day
-
task create and task update take --body-file and --stdinPossibly taken @JuanBarriosS claimed this today. Opencli enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
pyrite-wiki/pyrite#1687 · 1 comment ·
Maintainers usually reply within 1 day