arunbhardwaj / LeetHub-2.0

Automatically sync your leetcode solutions to your github account - with some updates to keep it working
https://chrome.google.com/webstore/detail/leethub-v2/mhanfgfagplhgemhjfeolkkdidbakocm
MIT License
242 stars 18 forks source link

Not synching if a problem is opened from a study plan #79

Open SimoneDelPrete opened 1 month ago

SimoneDelPrete commented 1 month ago

Describe the bug So the extension work perfectly if I open a problem and submit it, I can see it in my github repository. However, I am now following a study plan (the dynamic programming study plan). If I open a problem from the study plan page and then submit it, it is not included in my github repository.

To Reproduce Steps to reproduce the behavior:

  1. Go to a study plan page (e.g. Dynamic Programming)
  2. Click on a problem
  3. Submit it
  4. Solution not imported in github

Expected behavior In case a problem is submitted from a study plan I would like to see it in my github repository

Screenshots If applicable, add screenshots to help explain your problem. image

arunbhardwaj commented 1 month ago

I've been able to reproduce this issue and a fix will be deployed shortly! Thank you for the ticket!

SimoneDelPrete commented 1 month ago

I've been able to reproduce this issue and a fix will be deployed shortly! Thank you for the ticket!

Thank you so much for the amazing work <3

arunbhardwaj commented 1 month ago

Deployed! Please update the app and let me know if the extension now works for you @SimoneDelPrete

SimoneDelPrete commented 1 month ago

Deployed! Please update the app and let me know if the extension now works for you @SimoneDelPrete

Ok so, I was able to try it for some days, I confirm I am running the extension version 2.0.4.

Sometimes it works, sometimes not. Sometimes it's sufficient to close the browser and reopen it to push the code correctly. But, in case a new solution is found and accepted, it doesn't push it to github. Is it an intended behaviour or not?

arunbhardwaj commented 1 month ago

Refreshing the page will certainly help in some instances but the intended behavior is for it to try and push code if it has changed at all from the last submission -- without needing to refresh. Can you share some screenshots of what you're seeing and what is being output to your developer console (F12) and your extension error page (manage extensions > "Errors" under LeetHub)?

SimoneDelPrete commented 1 month ago

Refreshing the page will certainly help in some instances but the intended behavior is for it to try and push code if it has changed at all from the last submission -- without needing to refresh. Can you share some screenshots of what you're seeing and what is being output to your developer console (F12) and your extension error page (manage extensions > "Errors" under LeetHub)?

leetcode.com-1717360257246.log leetcode.com-1717360250150.log

These are the errors showing up in the console of the browser. I forgot to say, I am using Brave now.

I cannot find the errors in the page of the extension

I confirm you that if I refresh the page, the new accepted code is correctly pushed

arunbhardwaj commented 1 month ago

I was able to reproduce some of this behavior on the first run after install of Brave (or any new browser for that matter). The initial errors are due to the local cache not yet being up to date. Then, the extension immediately fetches for the current file values from GitHub and shortly after successfully pushes the new, updated files. I'll attach a screenshot of what I see on my end.

Note the red line separating the first and second submission. You can see the first submission has initial errors in pushing to GitHub, but then resolves them and pushes again - at which point we see the Successfully committed xyz to Github message.

brave test

Please let me know if this is the behavior you have on your end or do you have persistent errors?

P.S. Pushing the repo README.md file can sometimes persistently throw errors, which is not intended and I will issue a fix for that shortly.

SimoneDelPrete commented 1 month ago

Ok it seems that in case it is the first submission of the problem it works. Then, the next accepted submissions (with different code, I am trying different solutions) is not pushed until the browser is restarted.

However, I just noticed that you introduced the beta version of the manual push, which in my case works perfectly with different accepted codes, even though I keep the browser open