PATCH /report with an outdated report ID writes to the outdated record, so the served report stays pending
Mantenedores costumam responder em até 3 dias
Um pull request relacionado já foi integrado.
- #4044 de @PavelMakarchuk — integrado
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 18
- Forks
- 33
- Merge médio
- 2d 16h
- PRs com merge (30d)
- 53
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PolicyEngine/policyengine-api
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
PolicyEngine/policyengine-api#4037 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
PolicyEngine/policyengine-api#3911 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
PolicyEngine/policyengine-api#3910 ·
Mantenedores costumam responder em até 3 dias
-
Return a 400 for economy years the simulation service's model cannot projectTalvez já em andamento @anth-volk assumiu hoje. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
PolicyEngine/policyengine-api#4093 ·
Mantenedores costumam responder em até 3 dias
-
Document UK breakdown results' withheld area codes, and stop serving breakdowns cached without themAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 43/100
PolicyEngine/policyengine-api#4091 ·
Mantenedores costumam responder em até 3 dias
Todas as issues de PolicyEngine/policyengine-api
Issues semelhantes
-
fix(ui): serve bundled fonts from the gatewayTalvez já em andamento @dkritarth assumiu hoje. Abertaagent: in-progress agent: ready P3 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
dkritarth/scopewatch#336 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bob
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 72/100
khuisman/mcp-gee-sweet#1267 ·
Mantenedores costumam responder em até 1 dia
-
bug confirmed issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
open-webui/open-webui#33285 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
tv-list
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Gathin23/cleanyourtv#2337 ·
Mantenedores costumam responder em até 1 dia
-
bug P2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia