Skip to content
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

Multiple Attachment views in a single form, uploading file in one item also shows in other item. #1821

Closed
santosh-pingle opened this issue Jan 24, 2023 · 8 comments · Fixed by #1828
Assignees
Labels
effort:xsmall Extra small effort - 1 day P1 High priority issue type:bug Something isn't working

Comments

@santosh-pingle
Copy link
Collaborator

santosh-pingle commented Jan 24, 2023

Describe the bug
Questionnaire json file contains multiple attachment widgets.
When user start uploading file to respective attachment item, it also uploads same file to other attachment view.
When user delete file from other attachment view, application exits.

Referred questionnaire
component_attachment.txt

Captured video

Screen.Recording.2023-01-24.at.8.19.11.AM.mov

Component
SDC library

Expected behavior
Uploaded file should be shown in the respective attachment widget.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: Nokia 3.4
  • Android version: 12

Additional context
Add any other context about the problem here.

Would you like to work on the issue?
Please state if this issue should be assigned to you or who you think could help to solve this issue.

@santosh-pingle santosh-pingle added type:bug Something isn't working P1 High priority issue effort:xsmall Extra small effort - 1 day labels Jan 24, 2023
@santosh-pingle
Copy link
Collaborator Author

@FikriMilano

@FikriMilano
Copy link
Collaborator

@santosh-pingle thanks for the bug report, I will have a look

cc @f-odhiambo

@santosh-pingle
Copy link
Collaborator Author

@FikriMilano any updates on it? thanks!

@FikriMilano
Copy link
Collaborator

@santosh-pingle not much update, I was logging the logic and doesn't found anything wrong.

Still investigating, but I have a conjecture that it's related to the recycling of recycler view

@santosh-pingle
Copy link
Collaborator Author

santosh-pingle commented Jan 25, 2023

@FikriMilano similar issue was found in #1818, may be you need to clear the old state before binding the data to the item.

@FikriMilano
Copy link
Collaborator

@santosh-pingle I have created PR #1828 to close this ticket.

Yeah, it turns out we need to clear the preview if there is no answer. And it has to be declared when binding the view holder.

@FikriMilano
Copy link
Collaborator

The reason why the other widget is also seems to be uploaded is because it recycles from the top widget, which already been uploaded. But if we click Delete at the other widget, it crashes because the answer is null. So it only recycles the view but not the answer.

@FikriMilano
Copy link
Collaborator

So, yeah, by clearing the preview if there is no answer will fix the bug

@github-project-automation github-project-automation bot moved this from New to Complete in Android FHIR SDK Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:xsmall Extra small effort - 1 day P1 High priority issue type:bug Something isn't working
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

3 participants