-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix infinite loading circular progress bar after nominating for deletion #6324
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
base: main
Are you sure you want to change the base?
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.
I tried this branch and unfortunately when I tap the red button the progress thing kept circling fo several minutes.
Also, the picture it was about did not get the nomination banner:
https://commons.m.wikimedia.org/wiki/File%3AOktamov_Rozimattilla.jpg
Which variant did you tried? I tried on prodDebug and it worked. Also, what about the Toast message? |
prodDebug too. |
Yes, the logs would be helpful here, thanks :) |
I just found out that @parneet-guraya was already working on the fix. I just missed it and looked at @neeldoshii's draft PR. However, both of them are not working for @nicolas-raoul. Could you please try to record a screencast while reproducing the issue and logs would be very helpful in fixing this problem? |
Here is all I see in logcat after entering a deletion reason ad tapping
|
Do not hesitate to add much more logcat calls everywhere, then I can provide another log. :-) |
I've added some log statements depending on the expected flow of operation. Please try to repro the issue again and also a screencast as well. |
✅ Generated APK variants! |
Thanks! Here is what I am getting on Pixel 7 after entering a deletion reason and tapping
Strangely the app is otherwise working great, I even reinstalled it and it is loading all thumbnails very quickly from the Internet. Screencast taken at the same time as the logcat above: 395.mp4 |
Thanks for the logs @nicolas-raoul |
Both great ideas! 👍 |
Hi @nicolas-raoul, apps-android-commons/app/src/main/java/fr/free/nrw/commons/delete/ReasonBuilder.kt Lines 75 to 79 in c41b5cc
It's appended to the reason string which is passed when making a deletion request: apps-android-commons/app/src/main/java/fr/free/nrw/commons/delete/ReasonBuilder.kt Lines 58 to 61 in c41b5cc
As you mentioned, fetching achievements for a user with thousands of contributions is time-consuming. So, we should look for some other API that can get us From the logs:
It seems that it took about 3 minutes before throwing The /**
* Disables Progress Bar and Update delete button text.
*/
private fun disableProgressBar() {
activity?.run {
runOnUiThread(Runnable {
binding.progressBarDeletion.visibility = View.GONE
})
} ?: return // Prevent NullPointerException when fragment is not attached to activity
} |
Great research, thanks! I don't think it is vital to know the number of articles using the image, to perform the nomination. So, in case a timeout happens, how about proceeding with the nomination, just with the number of articles being unknown? |
Hmm, I think that also works but we also need to have a lesser timeout because currently, it's like 3 minutes which is enough to frustrate the user. Do know the reason for appending |
Frankly, I don't really think we need that number. Do you know what commit added it? (you can use "git blame") |
Okay, I am looking for the reason why it was added. |
This PR added the I also found these methods which return the file usage of a file: apps-android-commons/app/src/main/java/fr/free/nrw/commons/mwapi/OkHttpJsonApiClient.kt Lines 95 to 102 in af82cb2
And this one: apps-android-commons/app/src/main/java/fr/free/nrw/commons/mwapi/OkHttpJsonApiClient.kt Lines 131 to 135 in af82cb2
Do you think we can utilize the above method which uses the |
Sorry for the delay!
|
Description (required)
Fixes #5531
What changes did you make and why?
Parneet fixed the issue in his PR #5610 by making changes in the
MediaDetailFragment.java
file. However, that file was migrated toKotlin
and caused merge conflicts. So, I pull from his branch, copy the changes to the migrated file and refactor the related code for better code quality.Tests performed (required)
Tested prodDebug on Samsung A14 with API level 34.
Screenshots (for UI changes only)
After_Fix_Progress_Bar.mp4