Too many project info
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 68/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- performance
調査の方向性
Mergin/projects_manager.py の MerginProjectsManager.project_status() から始め、戻り値の形を変更する前に、その19個の呼び出し箇所を調べてください。次に、プロジェクトステータスダイアログと、現在の権限およびロールの入力元を追跡してください。完了条件は、ダイアログが1つのレスポンスから両方の値を取得し、既存の3つの値を受け取る呼び出し元が引き続き動作することです。
索引モデルが issue の本文から書いたものです。
説明
Current situation
Opening the project status dialog makes three back-to-back requests for the same project info, each returning the project's full file list.
In MerginProjectsManager.project_status() (Mergin/projects_manager.py):
| # | call | what it is after |
|---|---|---|
| 1 | self.mc.project_status(project_dir) → project_info(name, since=vN) |
files, version |
| 2 | self.mc.has_writing_permissions(project_name) → project_info(name) |
permissions.upload |
| 3 | self.mc.project_info(project_name)["role"] |
role |
permissions and role are sibling fields of the same ProjectSchema, and the since= response is already ProjectSchema(exclude=["storage_params"]). So the first response carries everything the other two go back to the server for.
Beyond the wasted payload, has_write_permissions and project_permission reach the dialog from two different responses. They are two snapshots of the same state and can in principle disagree, and the dialog uses one to warn about read-only access and the other to drive MerginProjectValidator.
What we want
One request per status dialog, with the permission and the role coming from the same response.
Proposed approach
Step 1 — plugin only. Drop has_writing_permissions and read both values off a single project_info call. Takes it from three requests to two, no client release needed:
project_info = self.mc.project_info(project_name)
dlg = ProjectStatusDialog(
pull_changes,
push_changes,
push_changes_summary,
project_info["permissions"]["upload"],
mp,
project_info["role"],
)
Step 2 — needs python-api-client. project_status() cannot simply return the server info as a fourth element: 19 call sites (db-sync, cli.py, the plugin) unpack exactly three values. A non-breaking shape is a richer method with the existing one as a thin wrapper:
def project_status(self, directory):
pull, push, summary, _ = self.project_status_with_info(directory)
return pull, push, summary
The plugin then calls project_status_with_info() and takes role and permissions from the response it has already paid for, bringing it to one request.
- 主要言語
- Python
- スター
- 45
- フォーク
- 21
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MerginMaps/qgis-plugin のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
MerginMaps/qgis-plugin#953 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MerginMaps/qgis-plugin#848 · コメント 1 件 ·
-
Project history and Remove locally fail in projects with long paths on Windows (> 260 characters)オープンbug windows
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
MerginMaps/qgis-plugin#967 ·
-
View changes and schema check use the wrong base copy for GeoPackages in subfolders対応中かも @harminius が 6 日前に担当しました。 オープンbug
MerginMaps/qgis-plugin#963 · 担当者 1 名 ·
-
Error when syncing project.対応中かも @harminius が 7 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 54/100
MerginMaps/qgis-plugin#960 · コメント 2 件 · 担当者 1 名 ·
MerginMaps/qgis-plugin の issue をすべて見る
似ている issue
-
bug(mcp): handle malformed and partial reranker responses safely対応中かも @KamilEjaz890 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
kubeflow/docs-agent#301 ·
メンテナーはふだん 4 日以内に返信
-
Update the demo docsオープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
pulp/pulp_workflow#78 ·
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
pgadmin-org/pgadmin4#10797 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
gcivil-nyu-org/team5-mon-fall26#132 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
gcivil-nyu-org/team4-mon-fall26#291 ·
メンテナーはふだん 1 日以内に返信