Skip to content

B_020_R2 CuratedDefaultQuestionStoreServiceModule in PAT makes questions not be in the import store.

🐜 Bug report

about: Short explanation 🔧

Questions get lost/don't show on PAT after upgrading to new version, 1.1.2

Version Information

PAT 1.1.1, 1.1.2

I'm seeing this behavior on

Remove this hint: these checkboxes can be checked like this: [x]

  • iOS device

  • Android device

  • Chrome

  • Firefox

  • Safari

  • Edge

  • Other

If you know, add the version of the browser

What is the expected behavior?

When a Pat upgrades to 1.1.2 their app, the previously imported questions should still be seen, found and usable on the answering page.

What is the actual behavior?

When a Pat upgrades questions aren't shown on the answering page.

Steps to Reproduce

Reproducing the bug is a bit cumbersome as you need to have access to the code and running apps.

Initial Verification

  1. Make sure you have a running HCP running
  2. Make sure you have a running PAT running
  3. Prepare one SC on the HCP for Depression.
  4. Send it over to the PAT.
  5. Access the Answering Page (day-query-run)
  6. Questions are there.
  7. Open the Webconsole > Application tab and check the rccstorage>rcc-import-questions.
  8. rccstorage>rcc-import-questions. is empty
  9. Open https://git.recoverycat.de/recoverycat/rcc-client/blob/2b526b5f5cce22106387b0b31ca0fb6273db1815/lib/features/src/curated/curated-questions/curated-default-questions/curated-default-question-store.service.ts#L49
  10. Change the version of the question to one digit above.
  11. Let the app compile
  12. The app reloads itself
  13. Access the Answering Page (day-query-run)
  14. You see that questions are gone.

If we remove CuratedDefaultQuestionStoreServiceModule from PAT base feature module and run the same experiment, rccstorage>rcc-import-questions is not empty.

Diagnostics

  1. Due to having added the CuratedDefaultQuestionStoreServiceModule to the base feature of PAT, transfers and backups of questions makes that the rcc-import-questions store be empty. Offending change: 1839cce1
  2. When this module is not part of the base features module, transfers and backups are transferred along and rcc-import-questions is not empty.
  3. The offending questions/store is the CuratedDefaultQuestionStoreServiceModule lib/features/src/curated/curated-questions/curated-default-questions/curated-default-question-store.service.ts.
  4. All got triggered at the end though these changes: #1251 (closed)
  5. The guard here: c0f81f38 prevents that questions are shown when one or more of them are undefined.

Bottom line:

The addition of the default questions to the PAT app to use the daily note in the starter questions instead of the daily note previously created in the starter questions store and guard on not showing questions when one of more of them are undefined make that the definition of the questions be not persisted as imported questions. This was triggered by the fixes in the default curated questions.

Remark: PAT should not load any questions.

Possible Solution

  1. (NEEDED) Remove CuratedDefaultQuestionStoreServiceModule from PAT base feature module.
  2. (NEEDED) Temporarily introduce the default questions with the previous versions into the runtime config. Add a sync mechanism to have the import symptom checks be defined in the import questions. This must happen on app start or reload. This code shall be removed in future versions.
  3. Maintain a copy of the daily notes in the starter questions, like here.
  4. Helm Charts: https://git.recoverycat.de/recoverycat.ops/rcc-helm-charts/-/merge_requests/68

this should be done only for the PAT.

Solution in the APP

  1. We temporarily store in the runtime config the questionconfigs for the last changes or versions in the CuratedDefaultQuestions. #1251 (closed)
  2. We get a list of symptom checks from the ImportSymptomCheckStoreService.
  3. We iterate per symptom check and
    • We get the question ids.
    • If the referenced question is not stored as its questionconfig in the ImportQuestionStoreService
      • We store the questionconfig in the ImportQuestionStoreService, which we get from the Runtime Config.
    • Else do nothing

Potential connected zammad issue (contains backup to check)

Zammad ticket 483

rcc-backup-2024-11-19-1732016610744.zip

Edited by Carlos Sanchez