apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Change snackbar's error message in the Another User's Page

Open kanahia1 opened this issue 1 year ago • 8 comments

When opening the user page (someone else's page), if the achievements are not loaded it shows an Snack bar with message "Something went wrong, We could not fetch your achievements" wouldn't it be better to change the "Something went wrong, We could not fetch {User's name}'s achievements"

313374445-73ed77ab-32d1-4315-bd14-aa1bbe34cccc

https://github.com/commons-app/apps-android-commons/assets/114223204/6fcd08d4-fc02-4d7a-b194-60ab0aceb8a6

label: good first issue, enhancement

kanahia1 avatar Mar 14 '24 16:03 kanahia1

I tried repeating the steps and the first thing I faced was a very long waiting time as shown in the video. Time was more than 1 minute but I recorded a small part of it.

https://github.com/commons-app/apps-android-commons/assets/101377978/fbd4871b-7ca5-4015-a202-0e869ac99c07

At last I get the same error message. Screenshot_20240316_101100

The reason was this

Fetching achievements statistics failed java.net.SocketTimeoutException: timeout at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:675) at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:684) at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.kt:143) at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.kt:96) at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106) at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154) at fr.free.nrw.commons.mwapi.OkHttpJsonApiClient.lambda$getAchievements$4$fr-free-nrw-commons-mwapi-OkHttpJsonApiClient(OkHttpJsonApiClient.java:249) at fr.free.nrw.commons.mwapi.OkHttpJsonApiClient$$ExternalSyntheticLambda0.call(Unknown Source:6) at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44) at io.reactivex.Single.subscribe(Single.java:3603) at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89) at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) 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:264) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)

We should figure out why is this happening with the server. Also, I see this behavior with many user pages.

rohit9625 avatar Mar 16 '24 04:03 rohit9625

This is what the server says: image

Clearly, it will be solved but I think should reduce the waiting time to 10 to 15 seconds. What did you say @kanahia1 ?

rohit9625 avatar Mar 16 '24 04:03 rohit9625

Hey @rohit9625 How about opening different issue since this issue is primarily focused on changing error message.

kanahia1 avatar Mar 16 '24 05:03 kanahia1

Yeah right, but I am gonna leave it for now as it is not that important. Server errors are not common, right? Well, are you working on changing the error message if not then I would like to proceed : )

rohit9625 avatar Mar 16 '24 05:03 rohit9625

@rohit9625 How about leaving this as good first issue since this could be great start for others!

kanahia1 avatar Mar 16 '24 05:03 kanahia1

Yes, you are right😀 It will be a good start for newcomers.

rohit9625 avatar Mar 16 '24 05:03 rohit9625

I would suggest rewording to "Something went wrong, We could not fetch achievements". That's as useful, and less complex.

nicolas-raoul avatar Mar 22 '24 14:03 nicolas-raoul

Taking it up.

neeldoshii avatar Mar 25 '24 14:03 neeldoshii

This issue can be closed as its fixed.

neeldoshii avatar Mar 27 '24 21:03 neeldoshii