-
Notifications
You must be signed in to change notification settings - Fork 96
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
Navigate Event Handler does not catch latest URL #31
Comments
@itsluminous Do you have an idea what we could try? |
The UrlChangeListener will always be one step behind, but that is exactly what makes it work. Perhaps we can add a second delay when someone does manual submit so that UrlChangeListener can read and save url. |
OK I understand. Thanks for your clarification! I have checked your last commit again :) I am not yet sure how we could implement a check for the manual push button. We either have the problem that the submission id in the url is lost (when button is clicked) or listener is called too late. Periodically polling is also not be the preferred way I think.... |
I tested in the last days and found an issue with the new approach. If we submit a solution to Leetcode after we have already submitted successfully, the checkmark will turn green immediately and push the previous solution (not the current) to GitHub because the listener is not called yet. Therefore, the solutions on GitHub will be exactly one step behind. Do you know what I mean? |
Weird, In my case it submits latest code when I click submit button.
In my case, I always see two different files being pushed. @raphaelheinz can you tell step by step how you could replicate issue? |
@itsluminous In my daily routine I update and optimize my solutions several times after I have already submitted successfully. Can you check following steps:
In the above case step 4) does not upload code 3) but code 1) a second time. In the previous approach the URL was parsed at that time - now the issue is that the url changed listener has not been called yet 🤔 |
@raphaelheinz I tried the steps you mentioned multiple times. I tried doing same in python as well, still I am not able to replicate. |
@itsluminous Thanks for your feedback! Hmm, I will check on Edge and Chrome later. Btw I am using Brave on Mac |
Describe the bug
The navigate event handler does not catch the latest URL but the previous URL. It is always exactly one click behind. Sometimes this leads to push the wrong submission to GitHub. It seems that the event handler is called before the actual link is changed 🤔
LeetHub-3.0/scripts/leetcode.js
Lines 1021 to 1031 in 1c4ed8a
To Reproduce
Steps to reproduce the behavior:
window.location.href
value.Expected behavior
The event listener should somehow access the latest URL instead of the previous URL.
Additional
This issue may be responsible for #29.
The text was updated successfully, but these errors were encountered: