Serious Bug, DayQueryRunPageComponent not getting destroyed leads to new questions not beeing recognized.
This bug is serious and very hard to reproduce (that's the greatest kind of bug -.-)
It is serious because it sometimes causes a SymptomCheck that was just received to not beeing processed properly and the user will not see it's questions right away (only after a reload). This leaves the user with the impression that the SymptomCheck was not properly transmitted.
The 'Meine Fragen'/'Answer questions' Button will always show the correct questions count regardless!)
How to reproduce
Remove the hot fix in DayQueryRunPageComponent (see .setup(), or search for "779"):
await this.symptomCheckMetaStoreService.ready
this.symptomCheckMetaStoreService.change$
.pipe(
takeUntil(this.destroy$)
)
.subscribe( () => {
void this.updateStartDate().then(() => this.update())
})
Create a new rather large SymptomCheck in some HCP variant. Change the Schedule, edit a question, add your own question. Let the HCP generate a QR Code. Let the Pat Scan. When the PAT is prompted to goto questions, confirm.
Now sometimes you will see the new questions, sometimes not. If you see the new questions. Go to the menu and delete all data. Send the same SymptomCheck again. When Pat is prompted, go to questions. Repeat until the new questions do not show up.
This might take a couple of tries.
Alternatively you can try checking if DayQueryRunPageComponent gets destroyed (see below). Delete all the data via the menu. Open Questions, close them, check if DayQueryRunPageComponent was destroyed, if it was delete all data. Repeat until it does not get destroyed. Transmit questions again, goto questions -> empty.
How to determine if DayQueryRunPageComponent gets destroyed?
Add some console.log
to the constructor of DayQueryRunPageComponent. Add another console.log
to DayQueryRunPageComponent.ngOnDestroy(). You will see that the bug (once the questions do not appear) will coincide with DayQueryRunPageComponent not getting destroyed.