You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The questionnaireStateFlow is a combination of two flows
Modification count
pageFlow
The expectation is that every time modificationCount changes i.e. every time an answer changes due to user action, the combination of the flow should trigger resulting in getQuestionnaireState emitting a new state that is continuously being collected by the QuestionnaireFragment.
We have noticed that the state is collected only when pageFlow changes and not when modification count changes.
Component
SDC library
To Reproduce
Steps to reproduce the behavior:
Open a questionnaire in debugging mode
Add a break point where adpater.submitList(list) is called.
Make a change in the any answer
The break point will not get triggered
Add a break point in getQuestionnaireState
Make a change in any answer
The Break point will trigger
Expected behavior
Combination of two flows should result in an emit operation when either of the flows change.
Values in state flow are conflated using Any.equals comparison in a similar way to distinctUntilChanged operator. It is used to conflate incoming updates to value in MutableStateFlow and to suppress emission of the values to collectors when new value is equal to the previously emitted one. State flow behavior with classes that violate the contract for Any.equals is unspecified.
Since QuestionnaireItemViewItem is just a wrapper around the questionnaireResponse items, the new state is always equal to the old one , even after an answer is changed. Unless there is a new enabled question or page change, the questionnairestateFlow will not emit.
Describe the bug
The questionnaireStateFlow is a combination of two flows
The expectation is that every time modificationCount changes i.e. every time an answer changes due to user action, the combination of the flow should trigger resulting in getQuestionnaireState emitting a new state that is continuously being collected by the QuestionnaireFragment.
We have noticed that the state is collected only when pageFlow changes and not when modification count changes.
Component
SDC library
To Reproduce
Steps to reproduce the behavior:
adpater.submitList(list)
is called.Expected behavior
Combination of two flows should result in an emit operation when either of the flows change.
This issue is linked #227
The text was updated successfully, but these errors were encountered: