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

Upload count does not get updated right away post successful upload

Open konohakesh opened this issue 8 years ago • 23 comments

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:

  1. Note the current upload count and then upload an image.
  2. 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: snap

Would you like to work on the issue? Yes, if it is not a duplicate issue and no one is already working on it.

konohakesh avatar Nov 06 '18 10:11 konohakesh

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. :)

misaochan avatar Nov 06 '18 16:11 misaochan

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?

konohakesh avatar Nov 07 '18 04:11 konohakesh

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 avatar Nov 07 '18 07:11 misaochan

@misaochan Thanks for sharing the insights.

konohakesh avatar Nov 07 '18 08:11 konohakesh

Referencing #2509 here, they are slightly different but solutions may be related.

neslihanturan avatar Mar 13 '19 13:03 neslihanturan

@misaochan the issue doesn't exist

Amrutha-korumilli avatar Dec 03 '19 05:12 Amrutha-korumilli

@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 avatar Dec 03 '19 07:12 nicolas-raoul

@nicolas-raoul View before uploading the image: WhatsApp Image 2019-12-03 at 12 37 05 PM

Image after uploading WhatsApp Image 2019-12-03 at 12 37 05 PM (2)

While uploading the current HSV image, the page is showing the previous image only, until the current image is uploaded completely Uploading WhatsApp Image 2019-12-03 at 12.37.05 PM (1).jpeg…

Amrutha-korumilli avatar Dec 03 '19 07:12 Amrutha-korumilli

** But, While uploading the current HSV image, the page is showing the previous image only, until the current image is uploaded completely** WhatsApp Image 2019-12-03 at 12 37 05 PM (1)

Amrutha-korumilli avatar Dec 03 '19 07:12 Amrutha-korumilli

@nicolas-raoul

Amrutha-korumilli avatar Dec 03 '19 07:12 Amrutha-korumilli

@nicolas-raoul This issue still exists.. the count is incremented only on application re-open.

Amrutha-korumilli avatar Dec 03 '19 08:12 Amrutha-korumilli

@kamrutha Can you see the number 1223 in my home activity below? Screenshot_20191203-171958_Commons 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.

nicolas-raoul avatar Dec 03 '19 08:12 nicolas-raoul

Ah, it seems that you have found the problem, great :-)

Now, please:

  1. run the app in debug mode
  2. find where the number is cached after it is retrieved the first time
  3. write a cache invalidation method which sets the cache variable to null, for instance
  4. find the Java source code which runs when an upload finishes
  5. At that place, call the method created at step 3

Good luck :-)

nicolas-raoul avatar Dec 03 '19 08:12 nicolas-raoul

@nicolas-raoul
I can see the number but as the count didn't increase after uploading an image WhatsApp Image 2019-12-03 at 1 55 39 PM

It incremented only after I CLOSE the app

Amrutha-korumilli avatar Dec 03 '19 08:12 Amrutha-korumilli

@nicolas-raoul Yes, I will work on it. Thanks ! :-)

Amrutha-korumilli avatar Dec 03 '19 08:12 Amrutha-korumilli

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 avatar Dec 03 '19 09:12 nicolas-raoul

@nicolas-raoul While I am trying to solve the above issue, I am not able to upload pictures, it is showing the following message. WhatsApp Image 2019-12-04 at 7 38 55 AM

Amrutha-korumilli avatar Dec 04 '19 15:12 Amrutha-korumilli

@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 avatar Dec 05 '19 04:12 maskaravivek

@maskaravivek Okay, Thanks!!!

Amrutha-korumilli avatar Dec 05 '19 04:12 Amrutha-korumilli

@nicolas-raoul I am facing problem in using cache invalidation. Could you please help me out in how to solve the issue?

Amrutha-korumilli avatar Dec 21 '19 10:12 Amrutha-korumilli