commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
1.02k stars 1.2k forks source link

Blank screen with only refresh button in Achievements #1816

Closed misaochan closed 4 years ago

misaochan commented 6 years ago

Summary:

User:Ainali is experiencing a blank screen with only a refresh button in his Achievements activity

screenshot

Commons app version:

2.8.0 beta

Would you like to work on the issue?

Pref not

tanvidadu commented 6 years ago

It might be because the information from the API's hasn't been fetched, and the current session has expired. Possible steps Taken: 1) Increase the session time. This might reduce the probability of session expiry. 2) Display a message regarding the session expiry and prompt them to try again later

misaochan commented 6 years ago

I don't think there would be any issues with increasing the session time, but are we able to do that from our end? @maskaravivek

maskaravivek commented 6 years ago

Yup, I don't think session duration could be controlled by the clients.

@tanvidadu which token are you using. In particular crsf token can be used once and is valid just for 10 seconds from the time it was generated.

The change that I did for the session management might affect all API calls that require an edit token. I will review the session management logic this Sunday and see if the comments left by Tgr could be used to modify some of our flows.

tanvidadu commented 6 years ago

I didn't explicitly mention any token while making api calls so I am not sure which token I am using. Is there any way to find it out?

maskaravivek commented 6 years ago

Oops, I forgot that you are not using a MediaWiki API.

The API that you are consuming doesn't depend on app's session. Its an anonymous API.

I guess the best you could do is gracefully handle the error by showing a snack bar or toast.

Also, we can probably check with @urbanecm if he has any statistics around urbanecmbot/commonsmisc/feedback.py failure rate and latency.

urbanecm commented 6 years ago

Hello everyone,

as of now, I have received 11 requests regarding said user, access.log (filtered to focus on this case) is on https://pastebin.com/raw/UgQf7NHa. Sadly, when writing the API, I've forgot to reflect error not only in JSON being returned to the called but also in the HTTP status code. Then, I have absolutely no clue if those requests were successful or not. I've updated the API so https://tools.wmflabs.org/urbanecmbot/commonsmisc/feedback.py?fetch=deletedUploads (invalid request, no user was given) gives 400 Bad Request (see following example how it will be recorded in the logs)

10.68.21.81 tools.wmflabs.org - [12/Aug/2018:15:13:01 +0200] "GET /urbanecmbot/commonsmisc/feedback.py?fetch=deletedUploads HTTP/1.1" 400 62 "-" "<user agent>" Last log in error.log (recording raised exceptions not handled in the program, like mysql server down) is from Jun 27 (errors raised by everything residing under tools.wmflabs.org/urbanecmbot), so at least no such error is causing this.

Requests like https://tools.wmflabs.org/urbanecmbot/commonsmisc/feedback.py?user=Ainali varies in time. I've tried on several users:

I can try to optimalize the queries to not take 17 seconds...

Martin

misaochan commented 6 years ago

Thanks so much for your help, @urbanecm ! :) I'll ask the user to try again.