PATCH /report with an outdated report ID writes to the outdated record, so the served report stays pending
Maintainer antworten meist innerhalb von 2 Tagen
Ein zugehöriger Pull Request wurde bereits gemerged.
- #4044 von @PavelMakarchuk — gemerged
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 18
- Forks
- 33
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 56
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PolicyEngine/policyengine-api
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
PolicyEngine/policyengine-api#4037 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
PolicyEngine/policyengine-api#3911 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
PolicyEngine/policyengine-api#3910 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Serve economy reports on the v2 routes and save v2 report and simulation IDsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
PolicyEngine/policyengine-api#4107 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Drop the unused x and y columns from API v2's UK area impact tablesEvtl. vergeben @anth-volk hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
PolicyEngine/policyengine-api#4102 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in PolicyEngine/policyengine-api
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesEvtl. vergeben @github-actions hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
admission-deferred priority: medium status: ready work-class: scoped
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
melodic-software/claude-code-plugins#10887 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
backend bug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
PoCInnovation/Distribox#255 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
google/langextract#598 ·
Maintainer antworten meist innerhalb von 1 Tag