server: config save/content endpoints convert OSError and UnicodeDecodeError into raw 500s; inconsistent missing-file semantics (400/404/200)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Read the config endpoints in routes/config.py at the cited locations for /load, /reload, /content, /save, and /save-as, then check the ValidationIssue[] contract in client.ts:36-54. Trace the read, decode, and write failures alongside the existing status responses. Done means the endpoints handle these failures consistently and the validation response shape follows the documented contract; the issue leaves the exact error status choice open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Error handling across the config endpoints is inconsistent and leaks tracebacks:
save_config_endpoint:on_disk_hash = content_hash(config_path.read_text(encoding="utf-8"))(routes/config.py:458) — raisesUnicodeDecodeError/OSError→ unhandled 500 before the staleness guard can answer 409.write_text_atomic(config_path, payload.content)(config.py:471) raisesOSErroron read-only target/full disk → raw 500 traceback instead of an actionable 4xx; same insave_as_config_endpoint(config.py:540).GET /content'sconfig_path.read_text(encoding="utf-8")(config.py:405) 500s on non-UTF-8 files.- Missing-file semantics for the same situation differ per endpoint:
/load→ 400 (config.py:171),/content→ 404 (config.py:400-403),/reload→ 200{"reloaded": false}(config.py:337-339). - Validation-failure shape is heterogeneous:
/saveand/save-asput the issue list indetail(HTTPException(400, detail=issues)) while every other 4xx uses a string, and/validatereturns the same data as a 200 body — three shapes for one concern (the client compensates inapiError(),client.ts:36-54).
Suggested fix
- Wrap the write/read calls in
try/except OSError as e: raise HTTPException(422 or 500-with-detail, f"Cannot write configuration file: {e}"). - Pick one missing-file status (404) for all three endpoints.
- Keep the list-detail 400s but document them in one place (they are already the
ValidationIssue[]contract inclient.ts).
- Lenguaje dominante
- Python
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 4 h 46 min
- PR fusionados (30 d)
- 55
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 falbany/ProFiles
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
falbany/ProFiles#187 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Web UI: config handoff from a second launch leaves the open YAML editor showing stale contentAbiertobug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
bug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
Todos los issues de falbany/ProFiles
Issues similares
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
aws-samples/sample-spec-driven-presentation-maker#648 ·
Los mantenedores suelen responder en 1 día
-
firestore: enable live window.yaml pipeline system tests once add_window_fields is in productionAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 64/100
googleapis/google-cloud-python#19115 ·
Los mantenedores suelen responder en 2 días
-
CRS WKT default to WKT2Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día