Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

PATCH /report with an outdated report ID writes to the outdated record, so the served report stays pending

Cerrado
#4,043 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
api, backend

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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PolicyEngine/policyengine-api

Todos los issues de PolicyEngine/policyengine-api

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.