Skip to content
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

Show github upload progress in the leetcode when submitted #118

Merged
merged 2 commits into from
Aug 10, 2021
Merged

Show github upload progress in the leetcode when submitted #118

merged 2 commits into from
Aug 10, 2021

Conversation

sbibek
Copy link
Contributor

@sbibek sbibek commented Aug 8, 2021

LeetHub currently doesn't report any kind of progress when submission is being uploaded to GitHub. The only way to check if LeetHub uploaded the submission is to check if the submission count in the extension popup has increased or by checking the GitHub repo itself. This PR adds the functionality of showing upload progress directly in the Leetcode. When the submission is successful and the LeetHub upload is triggered, a progress spinner on the left side of the "Run Code" button pops up. If the upload is successful, the spinner is replaced by a green check. Currently, the LeetHub codebase doesn't have a proper way to pass success/failure of the upload calls, I have added a callback for success just for this purpose. Adding one for failure seems like a bit of work right now. So, this feature starts a timeout of 10 seconds (should be sufficient) after the upload has started. If the upload is not completed by the end of 10 seconds, then the upload is concluded to have failed and a red check replaces the spinner.

Addresses #112

progresspr

Copy link
Owner

@QasimWani QasimWani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see comments and change structure accordingly.
Would love to see this in production!

@sbibek
Copy link
Contributor Author

sbibek commented Aug 9, 2021

Like you suggested, the spinner activates on the following condition
if the submission was successful and the "success" tag appears on the top.
A green check replaces the spinner as soon as upload to Github is successful.

The 10s function is there to just handle an edge case if the upload is unsuccessful for any reason. If the upload to Github is successful, the 10s counter is shut down. But if the upload is unsuccessful and the counter reaches 10s, the upload is tagged unsuccessful and a red check replaces the spinner.

Does this make sense?

@QasimWani QasimWani merged commit 76f1dbf into QasimWani:dev Aug 10, 2021
@SysSn13
Copy link
Contributor

SysSn13 commented Aug 10, 2021

These changes are breaking the flow of LC Explore page submissions. Please add support for explore section or handle the errors properly. This line is causing error in one case. There might be more cases.

@sbibek
Copy link
Contributor Author

sbibek commented Aug 10, 2021

@SysSn13 will check that.

@sbibek
Copy link
Contributor Author

sbibek commented Aug 10, 2021

@SysSn13 , I added the support for the "explore section" and a generic error handler is in place so that it doesn't break any other features. Any other areas you can think of this might affect?

@SysSn13
Copy link
Contributor

SysSn13 commented Aug 11, 2021

@sbibek I think that's enough. For leetcode, there are only two types of submission right now, normal problem and explore section problem. Make sure both of them are working.

@sbibek
Copy link
Contributor Author

sbibek commented Aug 11, 2021

@SysSn13 , Thanks.

@QasimWani
Copy link
Owner

have all the issues been fixed @sbibek? Made the cardinal sin of approving a PR without looking at it.
@SysSn13 assigned you to take charge of this PR.

@SysSn13
Copy link
Contributor

SysSn13 commented Aug 12, 2021

#120 A generic error handler is introduced for it which resolves this issue.

@sbibek
Copy link
Contributor Author

sbibek commented Aug 12, 2021

@QasimWani @SysSn13, Explore Submissions and cardinality checks available on #120. I think maybe we can create some kind of checklist of features so that we can verify the new features against that?

@BrajBliss
Copy link

My status is just red for a while, I have tried installing again but none works. Also tried to disconnect from GitHub Account settings and re-connect but the same issue.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants