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

Fixes bug #5721 (Crash when adding and then removing media details) #5750

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

pacha0
Copy link
Contributor

@pacha0 pacha0 commented Jun 4, 2024

Description (required)

Fixes #5721

I replaced uploadMediaDetail.get(position) with a direct reference to uploadMediaDetail in 3 locations to avoid out of bounds errors.

The usage of RecyclerView in this code is still a bit buggy, and maybe a RecyclerView is not necessary here since the number of items is limited. The fix also revealed problems in the logic of adding the "addButton" only to the last item, which couldn't be reproduced before because the app crashed first. I can submit a new bug for that if this fix goes live.

I did not feel very comfortable with the code so I restricted my commit to fixing the first reported crash.

Tests performed (required)

Tested with same steps described in #5721 on emulated Pixel 3 in AndroidStudio.

… details)

I replaced uploadMediaDetail.get(position) with a direct reference to uploadMediaDetail in 3 locations to avoid out of bounds errors.

The usage of RecyclerView in this code is still a bit buggy, and maybe a RecyclerView is not necessary here since the number of items is limited. The fix also revealed problems in the logic of adding the "addButton" only to the last item, which couldn't be reproduced before because the app crashed first. I can submit a new bug for that if this fix goes live.

I did not feel very comfortable with the code so I restricted my commit to fixing the first reported crash, which was resolved in my tests.
Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed still buggy (the app should not allow for ALL items to be deleted), but better than crashing.

Screenshot_20240606-150639.png

@nicolas-raoul nicolas-raoul merged commit 8fdfb8e into commons-app:main Jun 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Crash when adding and then removing media details
2 participants