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
[Bug]: App crashes when you click on Author Name #5187
Comments
If I understand correctly, tapping works when logged in, but crashes when not logged in? Great find, thanks! |
This is happening because the achievements section is accessible only to the logged-in users. @nicolas-raoul, what should be the ideal behaviour in this case? Do we intend to make it accessible to everyone? |
Crashing is never a good thing. For non-logged-in users, how about open a web browser on the user's Commons profile page? For instance https://commons.wikimedia.org/wiki/User:Syced Making it accessible to everyone is another idea, but may be more complex, and non-logged-in users probably do not care much about authors. |
Hi! I would like to work on this issue. Can you assign me this issue? I'm kinda new to contributing to projects but I would like to give it a try. |
@joseearias It is yours, thanks! Please let us know about your progress every few days. |
I will, thanks! |
Hi. So then are we agreeing on opening the user details on the device browser for non-logged-in users? I think I know how to solve the problem now. |
Yes, thanks! |
Hi. Is there a way to get the user Id through the application? The url of the page works with the id of the user but I can't seem to find a way to access this id in the application. Any guidance of where I could find this? |
Hi @joseearias, you can try accessing the user from the image information that the application fetches from the API call. |
I fixed the error and it doesn't seems to crash anymore. Would it be ok then if when the author's name is clicked the browser opens up a page with the user's profile on https://commons.wikimedia.org? |
@joseearias Yes sounds great, looking forward to your pull request :-) |
Actually, I am not able to reproduce the crash on master using the steps kindly provided by Priyank. |
Umm, that's weird. Screenrecorder-2023-04-07-19-37-40-607.1.mp4 |
Unexpected indeed. What I could interpret from the device logs is that it is throwing a NullPointerException at line number 184 because Line 184 in 67d2e7f
|
That's strange. It also keeps crashing for me by following the same steps. On both beta and prodDebug. |
The more interesting question is why is not crashing for Nicolas |
Thanks all for testing! I am using the latest stock Android 13 on Pixel 6. |
If the developers aren't handling the exceptions, then I think the behaviour would depend on the device. It would be unexpected; for some the app might crash, for others the device might simply ignore it.
@nicolas-raoul, do the achievements load for you? I tried adding the null check so that the else block executes for me too but this just loads the fragment with the text and icons. The numbers never get fetched and the progress bar keeps spinning. This does not happen in case I am logged in and I can see the numbers and the level badge too. |
Achievements/leaerboard/contributions all load fine on my device even when not logged in, on the master branch. Hopefully another core developer can reproduce the crash and test+merge the pull request. |
@nicolas-raoul I used Pixel 6 Android 13 and I was able to reproduce the issue and was able to test the fix. Post Fix - The author's page opened as follows - |
Summary
The app crashes when you click on Author Name of an image
Steps to reproduce
Expected behaviour
Details about the author should open
Actual behaviour
The app crashes
Device name
POCO X2
Android version
Android 11
Commons app version
4.0.3 prodDebug
Device logs
Screen-shots
No response
Would you like to work on the issue?
None
The text was updated successfully, but these errors were encountered: