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

Blank Achievements activity for some users #2042

Closed
misaochan opened this issue Nov 28, 2018 · 5 comments
Closed

Blank Achievements activity for some users #2042

misaochan opened this issue Nov 28, 2018 · 5 comments

Comments

@misaochan
Copy link
Member

misaochan commented Nov 28, 2018

Summary:

From a user on our google group forum: "Tried to view my achievements, nothing shows and I briefly saw an error message."

System logs:

2018-11-27 19:25:56,338     [INFO ] [file-logging-thread-1] [ApacheHttpClientMediaWi] : Url https://tools.wmflabs.org/urbanecmbot/commonsmisc/feedback.py?user=Ainali
2018-11-27 19:26:07,011     [ERROR] [file-logging-thread-1] [AchievementsActivity] : Fetching achievements statistics failed
java.net.SocketTimeoutException: timeout
	at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.java:593)
	at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.java:601)
	at okhttp3.internal.http2.Http2Stream.takeResponseHeaders(Http2Stream.java:146)
	at okhttp3.internal.http2.Http2Codec.readResponseHeaders(Http2Codec.java:125)
	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
	at okhttp3.RealCall.execute(RealCall.java:77)
	at fr.free.nrw.commons.mwapi.ApacheHttpClientMediaWikiApi.lambda$getAchievements$4$ApacheHttpClientMediaWikiApi(ApacheHttpClientMediaWikiApi.java:985)
	at fr.free.nrw.commons.mwapi.ApacheHttpClientMediaWikiApi$$Lambda$8.call(Unknown Source:6)
	at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)
	at io.reactivex.Single.subscribe(Single.java:3394)
	at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
	at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:579)
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)

Device and Android version:

Android 8.0.0 on a Samsung galaxy S7 Edge

Commons app version:

2.9

Screen-shots:

screenshot_20181127-192821_commons

Would you like to work on the issue?

Pref not

ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue Nov 29, 2018
* Added a sticky snack bar in achievements activity which shows up when fetch api fails
* Snackbar comes with an action button which on click retries fetch. This way user is never shown a blank screen and always has an option to retry fetches
@maskaravivek
Copy link
Member

I checked by calling the API for this user and it seems there's a lot of data corresponding to this user.

https://tools.wmflabs.org/urbanecmbot/commonsmisc/feedback.py?user=Ainali

The API is taking ~30 secs to respond.

@ashishkumar468 Can you check the timeout for our API calls. Maybe we can increase the API timeout.

@urbanecm Is there any way to cache the responses or reduce the API latency?

@urbanecm
Copy link
Contributor

I'll have a look on optimalizing the queries.

@maskaravivek
Copy link
Member

@urbanecm Have created an issue in the repo about one quick optimization that can be done.

commons-app/commonsmisc#4

@maskaravivek
Copy link
Member

maskaravivek commented Dec 1, 2018

As part of optimising the queries, I have submitted the following PRs.

commons-app/commonsmisc#5
commons-app/commonsmisc#6
commons-app/commonsmisc#7

ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue Dec 1, 2018
* Added a snack with retry when api in AA fails
* Increased connection timeouts in okhttpclient builder
neslihanturan pushed a commit that referenced this issue Dec 1, 2018
* Bug fix #2042
* Added a snack with retry when api in AA fails
* Increased connection timeouts in okhttpclient builder

* added missing string resource
@urbanecm
Copy link
Contributor

Hi all, I've looked on @maskaravivek 's pull requests and merged some of them. commons-app/commonsmisc#5 looks to be the last one unmerged, as the suggested query looks to took even more (1 min).

Also, I've reverted commons-app/commonsmisc#11, because of some issues I didn't spot before merging. See more in the pullrequest itself.

PS: I apologize for not looking into this problem myself, thank you @maskaravivek for doing so instead of me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants