Page MenuHomePhabricator

[GSOC 2024 Proposal]: Improve upload queue management and Nearby Feature
Open, Needs TriagePublic

Description

Profile Information

Name: Shashank Kumar
Email: shashank.kumar.phe22@itbhu.ac.in
Education: Indian Institute of Technology (BHU) , Varanasi
Github : shashankiitbhu
LinkedIn : Shashank Kumar
Location: Varanasi, India
Other Communication modes: Discord, Zulip, Telegram
Typical working hours: 9 am - 10 pm (IST) UTC+5:30

Synopsis

  • Wikimedia Commons Android App is an App that Enables user to Upload and Review Images (Contributions) through their Android Devices. The goal of this GSOC Project is to Improve the Upload Management Queue and Modernize the app.

Have you contacted your mentors already?

Yes

Deliverables

There are Main Three Divisions of this Project:
1. Improve Upload Queue Management:
2. Modernize the App
3. Split Nearby into a fast query for coordinates + a details query for each pin

Implementation Strategy

Improve Upload Queue Management

1. Making Upload Queue Behave as a Real Queue

  • The main objective here is Only One Upload Proceeds at a time , What needs to be done here is to make sure that due to No Reason, whether it is Retry of Failed Uploads or Pausing and Resuming Uploads or Making Multiple Uploads at the same time one after another.
  • Currently, there is no distinction between Queued Uploads and Not-Started Progress Bar but still we see two different visual Indicators Uploads which makes it Confusing for users. Hence It needs to be simplified to one tag - Queued which should be assigned only after the Upload Worker starts the Job of Uploading them.
  • Maintaining a Queue where only one Upload is in progress at a time, making sure all others are with a single label - Queued and possibly maintaining their queue position number to make sure that no two uploads overlap or get "stuck" as mentioned here - #5603

What is required here is to Introduce a mechanism hat dynamically updates the state of the uploads based on their position in the upload queue. This mechanism should ensure that only one upload is marked as STATE_IN_PROGRESS at any given time, while the others are either set to STATE_QUEUED or a new state indicating they are waiting to start.

Here is how I have planned it for now :

  1. Initially, Set all all items to STATE_QUEUED and only transition an item to STATE_IN_PROGRESS when it's actually being processed.
  2. Modify logic in the UploadWorker to manage state transitions between STATE_QUEUED and STATE_IN_PROGRESS more dynamically.

This is the Current UploadWorker Flow (Only Tracking Contribution) :

uploadworkerflow.png (3×2 px, 306 KB)

This is the Rough flow after the Modification :

UPLOAD_FLOW.png (3×3 px, 381 KB)

However, I plan to dive deeper into finding better solutions or to Improve current solution in my GSOC Period.

2. Building New UI for Pending Uploads

Clean Modern App Portfolio Mockup Presentation.png (1×1 px, 249 KB)

  • Make a Separate Pending Uploads Screen which Follows the above principles for a Real Upload Queue , In which only one upload is seen in Progress at a time
  • Making It Easier for users to see their Queued Uploads ,Paused Uploads, and Failed Uploads, this clarifies to the user that Failed Uploads will be added at the last of the Queue if retried and Paused Uploads are different from Queued Uploads
  • This provides users a clean way to see the status of their uploads and decide what action they should take.

3. Prevent Retries For Genuinely Failed Uploads #5284:

  • As mentioned here, Identify which reasons qualify as "Genuine"
  • Whitelist the "Genuine" reasons and check if Upload is Failed due to any of these reasons.
  • Only Retry if the Failed reason is not in the list of whitelisted reasons for failure.

4. Handling Failed Uploads

  • This Involves Fixing #5280 & #5283
  • For Issue #5283 , till this point, I have observed and also mentioned here that it only appears that the failed upload is going on Simultaneously but isn't going on, this seems to be an issue with Incorrectly updating the UI, However, it would require more extensive debugging and find a more reliable way to reproduce this to get to a conclusion.
  • For Issue #5280 , Based on the current method of reproduction, the reason for this Issue seems to be that the current logic for determining upload success or failure might be too simplistic, not accounting for partial successes (where the image is uploaded, but subsequent steps fail). To solve this, we have to more accurately track and update the state of uploads, taking into consideration partial successes and providing more accurate error feedback.

5. Preventing Duplicates #5608:

  • The task here is to first Investigate the reason for duplicates that arise in case of Multiple Uploads, Finding a reliable way to reproduce it is the first step.
  • There could be multiple reasons for this, as far as I have examined Upload Worker and the overall whole Upload Process during my contribution period I think it could related to the retry logic we currently have where the app is Incorrectly mistaking a stuck upload with a failed upload.
  • One good way to solve this is to Implement an upload anti-duplication logic in the UploadWorker, so even if we don't know the exact reason why duplicates are found we can be sure that no duplicates will be in the upload queue, I am interested in possibilities of using 'imageSHA' to uniquely Identify Contribution in UploadWorker and avoid duplicates.
Load pins as I move the screen, cache pins, and remove the "search this area" button : #5664

As suggested in the Issue description, this issue aims to Improve nearby making pins load faster by caching the pins and load pins automatically and removing the "search this area" button, I'll be Implementing the following features :

  • Automatically Load Pins and Remove the "Search this Area" Button
  • Implement a Caching Mechanism for Pins
  • Remove caching when the contribution is uploaded from that pin.

Timeline

PeriodTask Description
May 4 to May 26Community bonding period- Join community and connect with Mentors
- Introduction and connecting with other contributors
- Start working on taking feedback for the new UI for the Pending Uploads and Start working on Suggestions
- Create and Implement in Code the new UI
- Final Review, Testing, and Feedback for the UI
May 27 to May 31- Final Iteration on New UI Based on the Received Feedback
May 31 to June 2- Test Issue #5603 and Reliably Reproduce, Analyse and Confirm the Underlying reason for this Issue
June 2 to June 16- Based on the Results of the above task and current known Issues with Upload Queue Management, Modify and Implement Real Upload Queue Management
June 16 to June 18- Test Upload with the newly updated Upload Logic and solve Bugs if found
June 18 to June 20- Write tests for the new Implemented Methods and classes and add Java doc
June 20 to June 28- Fix Prevent retries for genuinely failed uploads #5284
June 28 to July 8- Prevent duplicates #5608
July 8 to July 12Mid Term Evaluations- Code Cleanup, Testing and Progress Report/Blog
July 13 to July 20- Fix Never show successfully uploaded images as "Failed": #5280
July 20 to July 22- Test and Analyse the Behaviour of the App After Fix, Write Tests and Java Doc
July 22 to August 1- Fix Enqueue failed uploads, rather than uploading them simultaneously with the ongoing upload: #5283
August 1 to August 4- Test and Analyse the Behavior of the app after the Changes, Wite Tests, and Java Doc
August 4 to August 16- Load pins as the user moves the screen, cache pins, remove "search this area" button:: #5664
August 16 to September 18- Test and Analyse the Behaviour of the App After Fix, Write Tests and Java Doc
August 18 to September 22- Finalise Changes , Code Quality Review and Improvements
August 22 to September 26- Update Documentation for changes, Write and Submit Report/Blog for all the Tasks Completed and Accomplishments, Learnings
August 26 to September 2Final Evaluations- Mentors submit final GSoC contributor evaluations

Participation

  • I plan to communicate through GitHub, Zulip, and any other suggested mediums
  • I plan to report the successful completion of tasks through detailed blogs on either Hashnode or Medium
  • I am available online during my working hours and I am always available on my Email.
  • I am also available during my working hours for Online meetings through Google Meet or Other Mediums if required.

Previous Contributions to Commons

I started Contributing to Commons in December 2023 and have made several pull requests since then. You can look at those here

Pull Requests Created By Me

Total : 32 :: BUGs : 16 Enhancements: 5 Migrations: 8
Merged: 32
Open: 0

S.No.PR No.Issue No.DescriptionStatus
1PR #5544#5522BUG Precise error message if the password has become invalid after password changeMerged
2PR #5466#5437BUG Crash in Upload Wizard when changing Android font sizeMerged
3PR #5618#5277Custom picker: Show different pictures that are currently being uploadedMerged
4PR #5468#5448BUG Nearby banner shows Item without imageMerged
5PR #5576#5558Do not reload everything after marking a picture as not for uploadMerged
6PR #5500#5474BUG App Crashes when Switched Between Dark/Light Mode in Location Picker ActivityMerged
7PR #5510#5505BUG Edit Category Crashes when Previous Button is ClickedMerged
8PR #5525#5521BUG Methods Usage Incompatible with Android API Level 21Merged
9PR #5590#4664Migrate Upload Package To View Binding from ButterknifeMerged
10PR #5503#5473BUG Changes Lost and App Crashes when Switched between Dark-Light Modes in Edit Description and CaptionsMerged
11PR #5665#4611Make custom image selector available from NearbyMerged
12PR #5655#5556[Bug]: Set Wallpaper Not Working CorrectlyMerged
13PR #5636#5630Option to Remove Specific Images from Upload WizardMerged
14PR #5594#4664Migrated Bookmarks Package From Butterknife to ViewBindingMerged
15PR #5601#4664Migrated Media Package to View BindingMerged
16PR #5595#4664Migrated CategoryDetailsActivity , MainActivity to View BindingMerged
17PR #5593#4664Migrated Contributions Package From Butterknife to ViewBindingMerged
18PR #5592#4664Migrated Explore Package From Butterknife to ViewBindingMerged
19PR #5591#4664Migrated Profile Package from Butterknife to View BindingMerged
20PR #5478#5477BUG Selected 18 pictures for multi-upload, but Upload Wizard only asks metadata for 1 pictureMerged
21PR #5550#5547BUG App Crashes after clicking on Explore in bottom NavigationMerged
22PR #5543#5537BUG Unable to upload DNG / RAW imagesMerged
23PR #5492#5470Show Details About Icon Labels when long pressedMerged
24PR #5493#5470Show Details About Icon Labels when long pressedMerged
25PR #5534#5532BUG Can't Open Privacy PolicyMerged
26PR #5604#4664Migrated Review Package to View BindingMerged
27PR #5519#5516BUG Peer Review Buttons not get disabled after voting an Image for deletionMerged
28PR #5660#4664Remove Butterknife from Project & Complete Migration from ButterknideMerged
29PR #5640#5627BUG Custom picker: thumbnails sometimes blankMerged
30PR #5639#5628BUG Custom picker sometimes crashing when marking many pictures as "not for upload" towards the bottomMerged
31PR #5648#5644BUG Fix Custom picker: "uploading" overlay icon disappears when marking another pic as "not for upload"Merged
32PR #5643#5642BUG No Precise Error Message After Error Due to Password Change [Related to 1st]Merged

Issues Created By Me

S.No.Issue No.DescriptionStatusType
1#5547App Crashes after clicking on Explore in bottom NavigationClosedBUG
2#5521Methods Usage Incompatible with Android API Level 21 (Target SDK Version)ClosedBUG
3#5505Edit Category Crashes when Previous Button is ClickedClosedBUG
4#5474App Crashes when Switched Between Dark/Light Mode in Location Picker ActivityClosedBUG
5#5532Can't Open Privacy PolicyClosedBUG
6#5516Peer Review Buttons are not disabled while the next image is Loading After Nominating it for deletionClosedBUG
7#5473Changes Lost and App Crashes when Switched between Dark-Light Modes in Edit Description and CaptionsClosedBUG
8#5630Option to Remove Specific Images from Upload WizardClosedEnhancement
9#5470Show Details About Icon Labels when long pressedClosedEnhancement
10#5642No Precise Error Message After Error Due to Password ChangeOpenEnhancement

PR Reviews By Me:

  1. Reviewed Pull Request #5575 and made this comments
  2. Review Pull Request #5578 and added some suggestions.

About Me

I am Shashank Kumar, a Sophomore at the Indian Institute of Technology (BHU), Varanasi, pursuing a B.Tech in Pharmaceutical Engineering & Technology. I have been programming since I was 12 and I have an immense love for building products and solving problems through programming.

How did you hear about this program?

I got to know about this program from a fellow developer at the farewell event of Google's Appscale Academy.

We advise all candidates eligible for Google Summer of Code and Outreachy to apply for both programs. Are you planning to apply to both programs and, if so, with what organization(s)?

I am only applying to Google Summer of Code.

Past Experience

I have been coding since I was 12 and I have been working in Java since then and even got certified as Oracle Certified Associate, Java SE 8 Programmer at 13. My Journey to Android App development started soon after and even became Google Certified Associate Android Developer at 14. I have been developing Android Apps since then and I have worked on a few Android app projects since then, a notable one which I made when I was in High School Android-Java Tutorial App which got more than 35000 Installs on Play Store.

One of the main Android App I built for - Opined, which is a Social Media Platform that I founded and where I handled all the tech ( Web and Backend in PHP - Laravel ) and
The Android App - Opined App :

  • Opined is an Anonymous Social Media Platform that eliminates the problem of biases created by personalization algorithms
  • The app is Built on Java and Kotlin/Jetpack Compose
  • Uses Sentiment Analysis to Rank User's Opinions
  • Fetches Latest News & Headlines and allows users to put their opinions on them
  • Got More than 10000 Installs on the Play Store
  • Got Selected in the 2022 Batch of Google Appscale Academy

Relevant Skills

  • Android App Development with Java and Kotlin
  • Jetpack Compose
  • Git and GitHub
  • Retrofit and REST APIs
  • Room Database and SQL
  • Unit Testing and Understanding of Robolectric
  • RxJava and Multi-Threading
  • Understanding of Wikimedia's APIs

Volunteer Experience

  • Core Team Member of Club of Programmers (Software Development Group), IIT (BHU) Varanasi
  • Backend Lead at Tech Team of Training and Placement Cell, IIT (BHU) Varanasi

Availability

Are you eligible for Google Summer of Code?

Yes.

Do you plan to submit any other proposal apart from this one?

Yes , this one

Do you have any other plans during the period of GSoC?

No, I do not have any other plans during the contribution period.

How many hours per week can you dedicate to this?

I can devote at least 40 hours per week and can extend it further if needed, I will have no major commitments during this period, and because of my end-of-semester breaks I won't have any academic commitments during this period either.

Have you been accepted to GSoC before?

No. I am applying to the GSoC program for the first time.

Post GSOC :

I like this project personally and I love how active and enthusiastic the whole contributors community in Commons Android. This community is something that I want to be part of for a long time and keep contributing to and improving this project even after GSOC and I'll be more than happy to be a part of major changes in this project. For example, transitioning to Kotlin or Migrating from RxJava (for which I have added a proposal here), I have tons of ideas for this project and would love to discuss and implement those over a long period.

Event Timeline

Shashankiitbhu renamed this task from [GSOC 2024 Proposal]: Improve upload queue management [DRAFT] to [GSOC 2024 Proposal]: Improve upload queue management.Mar 24 2024, 9:36 PM
Shashankiitbhu updated the task description. (Show Details)

@Nicolas_Raoul @RitikaPahwa4444 Can You Please review this proposal? I am looking forward to your feedback

Nice proposal! By "implement the new UI" in the timeline, do you mean you'll be making any changes to the code as well? Apart from minor code changes, doing preliminary research and brainstorming during this period might be helpful. Last year, Nicolas had suggested to upload a few pictures via the app, the task helped me make some super crucial observations! Since this year's idea partly extends the one that we had last year, it might help this year as well.

Looks great!

In addition to Ritika's notes, I just want to point out a small formatting issue in "PR Reviews By Me".

Shashankiitbhu renamed this task from [GSOC 2024 Proposal]: Improve upload queue management to [GSOC 2024 Proposal]: Improve upload queue management and Nearby Feature.Apr 1 2024, 2:29 PM
Shashankiitbhu updated the task description. (Show Details)