-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
There was a problem hiding this 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!
Like you suggested, the spinner activates on the following condition 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? |
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. |
@SysSn13 will check that. |
@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? |
@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. |
@SysSn13 , Thanks. |
#120 A generic error handler is introduced for it which resolves this issue. |
@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? |
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