The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
Describe the bug
When loading tasks or targets for the first time after the upgrade to 4.13, this error can occur.
To Reproduce
Steps to reproduce the behavior:
Install 4.12
Create an offline user. Log in with this offline user and create one pregnancy. Logout.
Login as admin and upgrade to 4.13.x . Logout.
Log in as the offline user again and navigate to tasks or targets page.
See error.
Expected behavior
No error.
Logs
main.js:1 Error getting targets TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Object.aggregateStoredTargetEmissions (main.js:1:1309050)
at Object.<anonymous> (main.js:1:1306901)
at Generator.next (<anonymous>)
at w (main.js:11:600733)
at x (main.js:11:600945)
at main.js:11:601004
at new r (polyfills.js:1:22887)
at Object.<anonymous> (main.js:11:600886)
at A.aggregateStoredTargetEmissions (main.js:1:1307030)
Screenshots
Environment
App: webapp
Version: 4.13
Additional context
This is due to a change in structure of the local rulesStateStore document.
Describe the bug When loading tasks or targets for the first time after the upgrade to 4.13, this error can occur.
To Reproduce Steps to reproduce the behavior:
Expected behavior No error.
Logs
Screenshots
Environment
Additional context This is due to a change in structure of the local rulesStateStore document.