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

submission gave red flag even the solution was Accepted #29

Open
frankbearzou opened this issue Mar 22, 2024 · 8 comments
Open

submission gave red flag even the solution was Accepted #29

frankbearzou opened this issue Mar 22, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@frankbearzou
Copy link

frankbearzou commented Mar 22, 2024

Describe the bug
the extension shows a red flag even the solution was Accepted.

To Reproduce
Steps to reproduce the behavior:
find a question that you already solved before. so the old code will retrieved by LeetCode.

  1. click reset button to clear the old code
  2. write the code
  3. click Submit button
  4. wait... I didn't do anything... just wait
  5. red flag

Expected behavior
Accepted solution should have green flag and submitted to GitHub. But now shows red flag without commit to Github.

Screenshots
image

@frankbearzou frankbearzou added the bug Something isn't working label Mar 22, 2024
@raphaelheinz
Copy link
Owner

Hey @frankbearzou,
I tried to reproduce this issue as you described, but pushing to GitHub worked on my side. Can you try to reproduce?

Unfortunately, the observers do not work 100%. Therefore, in rare cases the code may not be pushed to GitHub although submission to LeetCode was successful. I have not found a solution so far. I have described it in the README.

LeetHub-3.0/README.md

Lines 45 to 51 in ec9deb5

## Manual synchronization
Your submission may not be successfully uploaded to GitHub if you update the text in the editor too fast. It is necessary to wait for 4 seconds (until the spinner stops) after submitting the solution before entering new characters, switching languages, or switching editors. During this period, your solution is being pushed to GitHub, and the website should maintain its layout without alteration. While this process is less than ideal, we have not found a better solution so far. Sorry for this inconvenience! If you find a fix, your PRs are welcome!
In the meantime, we have added a manual synchronization button next to notes icon. Please use the manual sync button only after you have successfully submitted your solution to Leetcode.

We have added the manual synchronization button. You can use that on if such issues occur in the future. You can also try to reload the page.

@frankbearzou
Copy link
Author

Is this because I always click Run button and get success result before I click Submit?

But the manual Push button did work me.

image

@raphaelheinz
Copy link
Owner

Good to hear manual push button is working :)

It is fine to press "Run" first. It is only important to wait after you pressed "Submit". Do not click anything while the spinner is moving. I have again tried to reproduce but I had no luck. Can you describe more details? Does this issue always happen? 🤔

Can you check the logs in Chrome console (opening using F12). If there is an issue with the script, the error may be printed there.

@frankbearzou
Copy link
Author

frankbearzou commented Mar 24, 2024

I will try and add more logs. here is one.

image

here is one more.
image

network preview:
image

Payload:
{"query":"\n query submissionDetails($submissionId: Int!) {\n submissionDetails(submissionId: $submissionId) {\n runtime\n runtimeDisplay\n runtimePercentile\n runtimeDistribution\n memory\n memoryDisplay\n memoryPercentile\n memoryDistribution\n code\n timestamp\n statusCode\n lang {\n name\n verboseName\n }\n question {\n questionId\n title\n titleSlug\n content\n difficulty\n }\n notes\n topicTags {\n tagId\n slug\n name\n }\n runtimeError\n }\n}\n ","variables":{},"operationName":"submissionDetails"}

@raphaelheinz
Copy link
Owner

OK thanks, I will check

@frankbearzou
Copy link
Author

It works most of time on the current version 0.0.13, but just occasionally failed.
Is this because my computer is slow? or my network is slow?
image

@raphaelheinz
Copy link
Owner

You are right @frankbearzou , the problem could be that it takes too long to submit the solution. The script polls for 10 seconds after pressing the "submit" button if the solution is valid. If it takes longer, pushing to GitHub is aborted.
How long does it take to submit after pressing the submit button on your side?

@frankbearzou
Copy link
Author

if I press the the button, it will take less than 10 seconds. very strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants