Upload count does not get updated right away post successful upload
Summary:
After a successful upload, when 'My Recent Uploads' activity is shown, then upload count in the header is not incremented. It still shows the old count. But when you close and re-open the application, it shows the correct count.
Steps to reproduce:
- Note the current upload count and then upload an image.
- When you come back to 'My Recent Uploads' ,
Actual: You will see the upload count unchanged. Expected: It should have incremented by one.
System logs: NA
Device and Android version: Nexus 5X - Android 7.1.1
Commons app version: 2.8.5-debug-master 2.8.5 from Playstore
Screen-shots:

Would you like to work on the issue? Yes, if it is not a duplicate issue and no one is already working on it.
Thanks for the report! You are very welcome to work on it, but I would wait until v2.9 is out, because there will be significant changes to both the upload process and main activity. You can keep an eye on 2.9-release branch. :)
Alright @misaochan . Now that you are talking about 2.9 -release, can you please briefly tell me and other newbies that how do we go about releasing the commons apps? I am not aware of the release cycles and even though I read in one of the comments under an issue that v2.8.6 is out, I don't see it in Play Store. Can you explain this a bit how releases are done here?
Sure. :) You can see the procedure at https://github.com/commons-app/apps-android-commons/wiki/Project-maintenance . And to know our latest release, you can look at https://github.com/commons-app/apps-android-commons/releases .
v2.8.6 is a bit of a one-time anomaly, as it will remain in Google Play beta until v2.9 is out. You can still access it by signing up for beta testing.
@misaochan Thanks for sharing the insights.
Referencing #2509 here, they are slightly different but solutions may be related.
@misaochan the issue doesn't exist
@kamrutha Could you please post a screenshot showing the app's home activity just before and just after an upload? Thanks a lot :-)
@nicolas-raoul
View before uploading the image:

Image after uploading

While uploading the current HSV image, the page is showing the previous image only, until the current image is uploaded completely
** But, While uploading the current HSV image, the page is showing the previous image only, until the current image is uploaded completely**

@nicolas-raoul
@nicolas-raoul This issue still exists.. the count is incremented only on application re-open.
@kamrutha
Can you see the number 1223 in my home activity below?
If I upload 1 more picture now, the number should become 1224.
I guess you will see the number appear if you kill the app and restart it.
Ah, it seems that you have found the problem, great :-)
Now, please:
- run the app in debug mode
- find where the number is cached after it is retrieved the first time
- write a cache invalidation method which sets the cache variable to null, for instance
- find the Java source code which runs when an upload finishes
- At that place, call the method created at step 3
Good luck :-)
@nicolas-raoul
I can see the number but as the count didn't increase after uploading an image

It incremented only after I CLOSE the app
@nicolas-raoul Yes, I will work on it. Thanks ! :-)
If you are new to caches, this can be interesting to read:
https://en.wikipedia.org/wiki/Cache_invalidation
The best method for your case here is Purge, because it is the one that makes the lowest number of web requests in the long run.
@nicolas-raoul While I am trying to solve the above issue, I am not able to upload pictures, it is showing the following message.

@kamrutha The crash that you are facing was recently fixed by #3248. Can you check if you have the latest version of the master branch.
@maskaravivek Okay, Thanks!!!
@nicolas-raoul I am facing problem in using cache invalidation. Could you please help me out in how to solve the issue?