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
- Make sure you have a running HCP running
- Make sure you have a running PAT running
- Prepare one SC on the HCP for Depression.
- Send it over to the PAT.
- Access the Answering Page (day-query-run)
- Questions are there.
- Open the Webconsole > Application tab and check the rccstorage>rcc-import-questions.
- rccstorage>rcc-import-questions. is empty
- 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
- Change the version of the question to one digit above.
- Let the app compile
- The app reloads itself
- Access the Answering Page (day-query-run)
- 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
- Due to having added the
CuratedDefaultQuestionStoreServiceModule
to the base feature of PAT, transfers and backups of questions makes that thercc-import-questions
store be empty. Offending change: 1839cce1 - When this module is not part of the base features module, transfers and backups are transferred along and
rcc-import-questions
is not empty. - The offending questions/store is the
CuratedDefaultQuestionStoreServiceModule
lib/features/src/curated/curated-questions/curated-default-questions/curated-default-question-store.service.ts
. - All got triggered at the end though these changes: #1251 (closed)
- 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
-
(NEEDED) Remove CuratedDefaultQuestionStoreServiceModule from PAT base feature module. -
(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. -
Maintain a copy of the daily notes in the starter questions, like here. -
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
- We temporarily store in the runtime config the questionconfigs for the last changes or versions in the CuratedDefaultQuestions. #1251 (closed)
- We get a list of symptom checks from the ImportSymptomCheckStoreService.
- 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