PATCH /report with an outdated report ID writes to the outdated record, so the served report stays pending
Les mainteneurs répondent en général sous 3 jours
Une pull request liée a déjà été fusionnée.
- #4044 par @PavelMakarchuk — fusionnée
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Python
- Étoiles
- 18
- Forks
- 33
- Merge moyen
- 2 j 16 h
- PR mergées (30 j)
- 53
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PolicyEngine/policyengine-api
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
PolicyEngine/policyengine-api#4037 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
PolicyEngine/policyengine-api#3911 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
PolicyEngine/policyengine-api#3910 ·
Les mainteneurs répondent en général sous 3 jours
-
Return a 400 for economy years the simulation service's model cannot projectPeut-être pris @anth-volk l’a pris aujourd’hui. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
PolicyEngine/policyengine-api#4093 ·
Les mainteneurs répondent en général sous 3 jours
-
Document UK breakdown results' withheld area codes, and stop serving breakdowns cached without themOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 43/100
PolicyEngine/policyengine-api#4091 ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de PolicyEngine/policyengine-api
Issues similaires
-
parse names a key after a top-level multi() threshold Bitcoin Core v31.1 refuses as not validOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
btclib-org/btclib-wallet#587 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Judgment-Pack/judgment-pack-spec#275 ·
Les mainteneurs répondent en général sous 1 jour
-
ai-generated
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour
-
documentation good first issue priority: low size: XS
Difficulté 1/5 1-3 heures Accessibilité débutants 92/100
yeongseon/azure-functions-doctor-python#651 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Changaco/python-libarchive-c#146 ·