Too many project info
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- performance
Línea de trabajo
Empieza en Mergin/projects_manager.py, en MerginProjectsManager.project_status(), e inspecciona sus 19 sitios de llamada antes de cambiar la forma del valor de retorno. Luego sigue el diálogo de estado del proyecto y sus entradas actuales de permisos y roles; se considera terminado cuando el diálogo obtiene ambos valores de una sola respuesta, mientras los llamadores existentes de tres valores siguen funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 45
- Forks
- 21
- Merge medio
- 3 d 13 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MerginMaps/qgis-plugin
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
MerginMaps/qgis-plugin#953 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
MerginMaps/qgis-plugin#848 · 1 comentario ·
-
Project history and Remove locally fail in projects with long paths on Windows (> 260 characters)Abiertobug windows
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
MerginMaps/qgis-plugin#967 ·
-
View changes and schema check use the wrong base copy for GeoPackages in subfoldersPosiblemente ocupada @harminius la tomó hace 6 días. Abiertobug
MerginMaps/qgis-plugin#963 · 1 asignado ·
-
Error when syncing project.Posiblemente ocupada @harminius la tomó hace 7 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 54/100
MerginMaps/qgis-plugin#960 · 2 comentarios · 1 asignado ·
Todos los issues de MerginMaps/qgis-plugin
Issues similares
-
bug(mcp): handle malformed and partial reranker responses safelyPosiblemente ocupada @KamilEjaz890 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
kubeflow/docs-agent#301 ·
Los mantenedores suelen responder en 4 días
-
Update the demo docsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
pulp/pulp_workflow#78 ·
-
Invalid syntax in sshtunnelAbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
pgadmin-org/pgadmin4#10797 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
gcivil-nyu-org/team5-mon-fall26#132 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
gcivil-nyu-org/team4-mon-fall26#291 ·
Los mantenedores suelen responder en 1 día