Skip to content

Upload count does not get updated right away post successful upload #1984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
konohakesh opened this issue Nov 6, 2018 · 23 comments · Fixed by #4204
Closed

Upload count does not get updated right away post successful upload #1984

konohakesh opened this issue Nov 6, 2018 · 23 comments · Fixed by #4204
Labels

Comments

@konohakesh
Copy link
Contributor

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.

@misaochan
Copy link
Member

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 misaochan added the bug label Nov 6, 2018
@konohakesh
Copy link
Contributor Author

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?

@misaochan
Copy link
Member

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.

@konohakesh
Copy link
Contributor Author

@misaochan Thanks for sharing the insights.

@neslihanturan
Copy link
Collaborator

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

@Amrutha-korumilli
Copy link

@misaochan the issue doesn't exist

@nicolas-raoul
Copy link
Member

@KAmrutha Could you please post a screenshot showing the app's home activity just before and just after an upload? Thanks a lot :-)

@Amrutha-korumilli
Copy link

@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
Copy link

** 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
Copy link

@nicolas-raoul

@Amrutha-korumilli
Copy link

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

@nicolas-raoul
Copy link
Member

@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
Copy link
Member

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

@Amrutha-korumilli
Copy link

@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
Copy link

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

@nicolas-raoul
Copy link
Member

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.

@Amrutha-korumilli
Copy link

@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

@maskaravivek
Copy link
Member

@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.

@Amrutha-korumilli
Copy link

@maskaravivek Okay, Thanks!!!

@Amrutha-korumilli
Copy link

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

@nicolas-raoul
Copy link
Member

First, try to disable the cache code, so that the number is calculated everytime.

@neslihanturan
Copy link
Collaborator

We get a recent feedback about upload count is not updated at all.

@Prince-kushwaha
Copy link
Contributor

i want to work on this issue

neslihanturan pushed a commit that referenced this issue Feb 8, 2021
…essful upload

->implements the Callback method to update total number of media uploaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants