PATCH /report with an outdated report ID writes to the outdated record, so the served report stays pending
Los mantenedores suelen responder en 3 días
Ya se ha fusionado un pull request relacionado.
- #4044 de @PavelMakarchuk — fusionado
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by reading resolve_report_output and update_report_output, then inspect the unit test reproduction described in the issue. Trace how the outdated ID maps to the current report and how the PATCH selects a record. Done when updating through the outdated ID completes the current report returned by GET, with a regression test covering that flow.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
When a report is stored under an outdated report-output cache version, GET /{country_id}/report/{id} serves the current report for the same simulations and year (creating it if needed) and labels it with the requested ID (response_id). The app then saves the result it computed with PATCH /{country_id}/report and that same ID. update_report_output selects the record by ID, which is the outdated one, and writes the result there. The current report that GET serves stays pending, so the report never completes, and every visit recomputes it.
Reproduced in a unit test on master (ed036b43): after resolve_report_output(outdated_id) and update_report_output(outdated_id, status="complete", output=...), the outdated record holds the new output and resolve_report_output(outdated_id) still returns the current record as pending with no output.
Why it matters now
The report-output cache version includes the country package and policyengine versions. #4024 changed them, so every older v1 report (UK and US) is now outdated and goes through this path the next time it opens.
Related
#3946 reports a 500 on the same PATCH for reports 4501 (US) and 4729 (UK). This bug explains why such reports stay pending; the 500 itself does not reproduce on the SQLite test database, so its cause still needs the production log.
🤖 Generated with Claude Code
- Lenguaje dominante
- Python
- Estrellas
- 18
- Forks
- 33
- Merge medio
- 2 d 16 h
- PR fusionados (30 d)
- 53
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 PolicyEngine/policyengine-api
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
PolicyEngine/policyengine-api#4037 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
PolicyEngine/policyengine-api#3911 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
PolicyEngine/policyengine-api#3910 ·
Los mantenedores suelen responder en 3 días
-
Return a 400 for economy years the simulation service's model cannot projectPosiblemente ocupada @anth-volk la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
PolicyEngine/policyengine-api#4093 ·
Los mantenedores suelen responder en 3 días
-
Document UK breakdown results' withheld area codes, and stop serving breakdowns cached without themPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 43/100
PolicyEngine/policyengine-api#4091 ·
Los mantenedores suelen responder en 3 días
Todos los issues de PolicyEngine/policyengine-api
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
MIT-LCP/wfdb-python#590 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
pollen-robotics/reachy_mini#1517 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
NRLMMD-GEOIPS/pluginify#41 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
scverse/spatialdata#1293 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
UKGovernmentBEIS/inspect_evals#2788 ·
Los mantenedores suelen responder en 1 día