-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deep copy for answers in question view item. #2576
Remove deep copy for answers in question view item. #2576
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good thanks. Can you create an issue with the video and add a link to the issue in the test case (after @Test
)
done. |
* delete operation on updated answers. * Remove deep copy for answers. * unit test. * unit test. * link the issue to added test. --------- Co-authored-by: Santosh Pingle <[email protected]>
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2593
Description
Earlier, the answers property was initialized by performing a deep copy of the answers from the questionnaire response component. Because of this, when the questionnaire response answers were modified later, the answers property was not synchronized with the modified answers. As a result, the old answers were referred to, which were not synced with the modified answers of the response item.
Now, the issue is fixed by not performing the deep copy operation on the response item answers when the answers property is initialized.
Alternative(s) considered
Other fix was just use
responseItemComponent.answer
instead ofanswers
in removeAnswerAt(index) function,Type
Choose one: (Bug fix)
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.