Comments (2)
Great Idea ✨ to create a discussion channel
from apps-android-commons.
After a lot of debugging and uploading a decent amount of pictures on Commons, this is the flow I observed (posting here for everyone's benefit) :
(Just so everyone understands the reference, STATE_QUEUED means, the item will have a ‘Queued’ tag and STATE_IN_PROGRESS means, the item will have a non-started progress bar animation)
- When the upload starts for the first time, all pictures are by default given the STATE_QUEUED in UploadPresenter.
- In UploadWorker’s doWork(), all items which are in STATE_QUEUED & STATE_QUEUED_LIMITED_CONNECTION_MODE are converted to STATE_IN_PROGRESS.
- In UploadWorker’s doWork(), for the current item getting uploaded, the state is again set to STATE_IN_PROGRESS and continues that till it gets uploaded successfully and gets the STATE_COMPLETED or pauses and gets the STATE_PAUSED or fails and gets the STATE_FAILED.
- If the current item upload succeeds, then the same process (step 3) is repeated for the next item.
- If the user closes the app, and comes back to ContributionsFragment, then all other items in STATE_IN_PROGRESS are converted to STATE_QUEUED by checkAndResumeStuckUploads() in MainActivity.
- If any item’s upload fails, it goes to STATE_FAILED and stays as it is, till either the user hits the retry button or the user closes the app and reopens it (since retryUploads() is called in onResume() of MainActivity) and they are given the STATE_QUEUED in restartUploads(), and step 2 follows. The STATE_FAILED items are not automatically re-tried, even if there is no other item left to be uploaded until the user closes the app or opens another activity and reopens MainActivity.
There are some issues with the pause and resume buttons as well, but since they are not a part of the given task, it would be better to discuss them here.
(i) I suggest to set the state to STATE_IN_PROGRESS only when the item is currently being uploaded, that is to skip step 2 and go to step 3 directly. By, doing this, only the current item being uploaded will have a progress bar and the rest will have a Queued or Failed or Paused tag.
(ii) I recommend to start the upload of the Failed items, when no other item is left to be uploaded, even when the user doesn’t close and reopen the app.
(iii) I also suggest to set the tag of STATE_QUEUED items with a 'Queued (N)' tag, where 'N' represents the position of the image in the uploads queue, which will update as and when another image is paused or fails or gets uploaded successfully.
This will create a standard upload flow, wherein only the item currently getting uploaded will have a progress bar and other items will have a 'Queued (N)' tag or 'Paused' or 'Failed' tag.
Below, I have attached a rough flowchart of what an ideal flow should be, according to me :
Suggestions and feedback regarding the above flow are more than welcome :)
from apps-android-commons.
Related Issues (20)
- Add location button UI not being updated when user clicks yes in similar image dialog HOT 8
- Adventure: Suggest a route of X kilometers around me, via as many Nearby points as possible HOT 2
- [Bug]: Crash in UploadWizard when one is cancelled using alertDialog and then another is removed using the cross button on top thumbnail
- Nearby -> Custom picker: Only allow 1 picture to be selected HOT 9
- Photo check - hidden categories
- Nearby -> System picker: Only allow 1 picture to be selected HOT 6
- Completely do away with the doNotAskForLocationPermission global state HOT 1
- [Bug]: App doesn't show CAPTCHA that may be required for log in HOT 8
- Limits
- Enhancing Greek Localization HOT 2
- When editing pic's location, default to the picture's currently set location HOT 5
- [Bug]: values-yue-hant preventing build HOT 7
- [Bug]: Commons app not showing pictures uploaded via web HOT 3
- Change `Unknown` on pointer click to ... (Nearby Activity) HOT 5
- Allow pasting in custom locations
- Nearby: Pins overlapping place name
- Resolve redirect categories on upload
- [Bug]: Location marker appears twice sometimes HOT 2
- [Bug]: Voice input icon should be shown only when corresponding services are available HOT 8
- Add a {{taken with}} template when the camera model is known. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apps-android-commons.