Research of a bug present in BE - JU-DEV-Bootcamps/ERAS GitHub Wiki
Bug: Cohort is not retrieving the correct value
Currently, in the ERAS system is returning an incorrect value for Cohort 4 (Julio 2024) because of a misconfigured value in some questionnaires. This affects the system displaying: Cohort (Julio 2024).
Expected behavior vs Actual behavior
ERAS displays the cohort without the number of cohort (4):
However, ERAS expects the cohort like Cosmic Latte:
Root Cause
The .json files obtained before download definition from the questionnaires have an error in the “value” field for Cohort 4 (Julio 2024)
{
"choice": {
"type": "text",
"body": {
"en": "Cohort 4 (Julio 2024)",
"es": "Cohort 4 (Julio 2024)"
}
},
"value": "Cohort (Julio 2024)"
},
This error is present in the following questionnaires in the “Organization Questionnaires”:
- Easy poll (dev-prueba)
- Encuesta de Testeo de Caracterizacion 202555555
- Encuesta de Testeo de Caracterizacion 2025TEST GABBY
- Poll (dev-prueba)
- Test Poll Versioning
- Test Poll Versioning - bug replication
- Test Poll Versioning [ma]
- TestGre - Test Poll Versioning
- backup - Test Poll Versioning
So, every poll that uses these questionnaires has the same issue.
Actions Taken
The steps taken to resolve the bug followed a debugging process. In the Organization Questionnaires section, we attempted to change the value of the options for the cohort question after changing the status of the questionnaires to “unpublished.” However, the button to change the value—not the label—was disabled.
The Cosmic Latte team reported that this is the expected behavior unless the questionnaire is in draft status (in which case, there must be no evaluations associated with that questionnaire). Since this is an error that occurs when creating the questionnaire, the template was shared with Jala University staff to prevent this error in production.
Conclusion
The issue is external and is not caused by the ERAS or the Cosmic Latte system. It is only a mistake in the value corresponding to the label displayed in the cohort list. If we replace it into the code to fix the bug, the value will be hardcoded, which will result in poor code quality.
Currently, it is important to have the value rather than the label via the Cosmic Latte service’s API endpoint; therefore, this bug cannot be fixed, and polls that have already been created cannot be changed due to the behavior of the Cosmic Latte platform.
The bug will be closed, and it is expected that these errors will not occur in future polls.