medic / cht-core

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.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
467 stars 217 forks source link

cht-form printing errors to console #9561

Open jkuester opened 2 weeks ago

jkuester commented 2 weeks ago

Describe the issue It appears that the changes.service.ts has leaked into the cht-form web component. Now, when it tries to initialize, it fails and just spams the logs endlessly every 5 sec with

Error initialising watching for db changes TypeError: Cannot read properties of undefined (reading 'update_seq')
    at eval (main.js:2)
    at H.invoke (polyfills.js:1)
    at Object.onInvoke (main.js:2)
    at H.invoke (polyfills.js:1)
    at ne.run (polyfills.js:1)
    at eval (polyfills.js:1)
    at H.invokeTask (polyfills.js:1)
    at Object.onInvokeTask (main.js:2)
    at H.invokeTask (polyfills.js:1)
    at ne.runTask (polyfills.js:1)
jkuester commented 2 weeks ago

Looks like the culprit is the extract-lineage.service which now depends on:

EnektoService > ExtractLineageService > UserSettingsService > CacheService > ChangesService.

I am thinking we either need to move the new user-centric functionality out of the ExtractLineageService or we need to push the ExtractLineageService call up out of EnketoService....