server: GET /api/config first-paint directory selection diverges from launch resolution; GET mutates ServerState; phantom config_path for trials
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with routes/config.py, especially _config_response and _choose_active_directory, then read config_service.choose_active_directory in service.py and the trial handling in /load-content and /content. Trace how ServerState initializes its config and active directory before moving initialization out of the GET handler. Done when first paint follows launch directory selection, GET has no state mutations, and trial responses identify the session and return config_path: None.
索引モデルが issue の本文から書いたものです。
説明
Problem
Two divergent selection algorithms coexist in routes/config.py:
_choose_active_directory(used by load/drop/create/reload) calls the core single-source-of-truthconfig_service.choose_active_directory("Single source of truth shared by desktop launch resolution and the server's config load/drop endpoints",service.py:178-180).- But the first-paint fallback inside
_config_responsehand-rolls its own (config.py:99-116):
selected = config_service.auto_select_directory(cfg, hostname) # display-name match, no search_dir preference
if selected and Path(selected).exists():
state.active_directory = Path(selected)
elif available_dirs:
state.active_directory = Path(available_dirs[0])
auto_select_directory returns a machine display name or first scan path (never search_dir first, no existence ranking), while choose_active_directory prefers search_dir then hostname-matched scan dirs. A config with search_dir=D1 and a hostname-matched machine scanning D2 launches on D1 but the web session's first GET /api/config activates D2 — session behavior diverges from launch behavior until a load/reload normalizes it.
Additionally:
GET /api/config(a read) mutatesstate.config_path,cfg.config_pathandstate.active_directory(side effects in a GET handler).- The response never includes
session_trial(only/load-contentappends it,config.py:277), so after a page refresh the UI cannot tell it is on a trial — yet the response still advertises"config_path": str(phantom)and"config_exists"for that phantom (config.py:131-132), contradictingGET /content's carefulconfig_path: Nonefor trials (config.py:390-396).
Suggested fix
- Replace the hand-rolled block with
_choose_active_directory(cfg, None). - Move the initial-state derivation into a ServerState/bootstrap method instead of a GET handler.
- Include
session_trial(andconfig_path: Nonefor trials) in_config_response.
- 主要言語
- Python
- スター
- 1
- フォーク
- 1
- 平均マージ
- 4時間 46分
- マージ済み PR(30日)
- 55
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
falbany/ProFiles の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ip-tools/patzilla#219 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
EPSSClient commits to its SQLite cache once per score: a 100-CVE bulk fetch makes 101 disk flushesオープンpriority:p3 technical-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
jimmy058910/jmo-security-repo#1673 ·
メンテナーはふだん 1 日以内に返信
-
enhancement ready
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
integration: frontier_silicon
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
home-assistant/core#193176 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
task create and task update take --body-file and --stdin対応中かも @JuanBarriosS が今日担当しました。 オープンcli enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
pyrite-wiki/pyrite#1687 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信