Apps-android-commons: Blank Achievements activity for some users

Created on 28 Nov 2018  路  5Comments  路  Source: commons-app/apps-android-commons

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

achievements bug

All 5 comments

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?

I'll have a look on optimalizing the queries.

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

https://github.com/urbanecm/commonsmisc/issues/4

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

urbanecm/commonsmisc#5
urbanecm/commonsmisc#6
urbanecm/commonsmisc#7

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

Also, I've reverted urbanecm/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.

Was this page helpful?
0 / 5 - 0 ratings