Skip to content

Conversation

@ashishkumar468
Copy link
Collaborator

Description (required)
When the api call to fetch the achievements somehow fails, a blank screen shows up and user is left with no option to retry.
Fixes #2042 Achievements is blank for some users.

What changes did you make and why?

  • Added a snack with retry when api in AA fails
    • Increased connection timeouts in okhttpclient builder

Tests performed (required)

Tested {build variant, ProdDebug} on {One Plus 3T} with API level {27}.

Screenshots showing what changed (optional - for UI changes)
device-2018-11-29-230404

* Added a snack with retry when api in AA fails
* Increased connection timeouts in okhttpclient builder
Copy link
Contributor

@maskaravivek maskaravivek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@neslihanturan
Copy link
Collaborator

Thanks @ashishkumar468 . I have tested this PR:

  • Timeout is long, as we wanted.
  • But retry button doesn't work.
    • Turn off internet connection
    • Try to load achievements
    • When retry button appeared, turn on internet connection
    • Click to retry button
    • It doesn't work anyway

@codecov-io
Copy link

Codecov Report

Merging #2056 into 2.9-release will increase coverage by 0.01%.
The diff coverage is 20%.

Impacted file tree graph

@@              Coverage Diff               @@
##           2.9-release   #2056      +/-   ##
==============================================
+ Coverage         4.06%   4.07%   +0.01%     
==============================================
  Files              224     224              
  Lines            11311   11329      +18     
  Branches          1045    1046       +1     
==============================================
+ Hits               460     462       +2     
- Misses           10817   10833      +16     
  Partials            34      34
Impacted Files Coverage Δ
...bookmarks/pictures/BookmarkPicturesController.java 0% <0%> (ø) ⬆️
.../main/java/fr/free/nrw/commons/utils/ViewUtil.java 0% <0%> (ø) ⬆️
...ee/nrw/commons/media/MediaDetailPagerFragment.java 0% <0%> (ø) ⬆️
...nrw/commons/achievements/AchievementsActivity.java 0% <0%> (ø) ⬆️
.../java/fr/free/nrw/commons/di/NetworkingModule.java 90% <100%> (+2.5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e29f4f...fc79267. Read the comment docs.

@ashishkumar468
Copy link
Collaborator Author

@neslihanturan Strange, works for me, what happens when you click on retry ?

@neslihanturan
Copy link
Collaborator

Progress bar appears, then it displays retry button again.

@neslihanturan
Copy link
Collaborator

Well, it worked this time. I think it took some time my emulator turn on connection, and I tested fast. So code should be fine. Thanks @ashishkumar468 !

@neslihanturan neslihanturan merged commit 568f807 into commons-app:2.9-release Dec 1, 2018
@ashishkumar468 ashishkumar468 deleted the bugfix/connection_timeouts branch December 1, 2018 14:28
@neslihanturan neslihanturan changed the title Bug fix #2042 Bug fix #2042 Achievements is blank for some users. Dec 3, 2018
@misaochan
Copy link
Member

Has anyone tested this by putting Ainali's username into the debugger to check the API response?

@neslihanturan
Copy link
Collaborator

I just tried, it didn't worked on first trial. Then I retried, it worked. So we should set timeouts for longer periods.

@vanshikaarora
Copy link
Contributor

Hey i have made some changes here.
#2087

May be this can solve the concerned issue.

neslihanturan pushed a commit that referenced this pull request Dec 19, 2018
* Fix memory leak due to wikidata edit listener (#2048)

* Fix bookmark crash fix (#2047)

* Fix bookmark crash fix

* Fix check for bookmark creator

* Bug fix #2042 (#2056)

* Bug fix #2042
* Added a snack with retry when api in AA fails
* Increased connection timeouts in okhttpclient builder

* added missing string resource

* Bugfix/duplicate categories (#2080)

* Increased timeout to 60 seconds

* Bug fix #1550
* filter duplicate categories

* Fix crash because of inactive fragment UI (#2046)

* Fix crash because of inactive fragment UI

* Add java docs

* Add information icon action Fiixes #2055 2.9.0: the 'i' icon in nearby doesn't do anything (#2057)

* Localisation updates from https://translatewiki.net.

* Remove unused mediawiki api dependency (#1991)

* Categories with pipe suffix (#1873)

* Bug fix issue #1826
Changes made :
-Certain category names used to show suffixed with strings prefixed with pipe '|'. Removed everything after the pipe. As per the discussion on the thread, its safe to remove everything after the pipe, including the pipe

* review suggested changes
*Code formatting
*Extracted out the index of pipe in a variable
*Added issue link in comments

* Remove libraries section from README (#1988)

* Remove libraries section from README

* Add wiki link to "libraries used" to README

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Use alert dialog instead of popup window, for nearby information

* Revert irrelevant changes, sorry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants