kaiwk / leetcode.el

An Emacs LeetCode client.
GNU General Public License v3.0
396 stars 70 forks source link

Unable to login using the latest version #38

Closed bethandtownes closed 4 years ago

bethandtownes commented 4 years ago

I check the trace which says that leetcode problems refresh is a void definition... I am using emacs 26.3 and installed this package from Melpa.

((("User-Agent" . "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:66.0) Gecko/20100101 
Firefox/66.0") ("X-Requested-With" . "XMLHttpRequest") ("Referer" . "https://leetcode.com
/accounts/login"))) (nil) (error) leetcode--loading-mode -1 plist-get :error message 
"LeetCode fetch user and problems failed: %S" json-read url-request-method url-request-
extra-headers url-http-end-of-headers] 6])] 2]) (nil) (error)] 4])] 2]) (#2) (#[0 "\301\302
\300\242\"\207" [(#2) signal iter-end-of-sequence] 3]) :close nil :next make-byte-code 0 
"\303\242?\205\0\300\302\242\240\210\301\304\240\207" vconcat vector [nil] 2 cps--
yield t error "unknown iterator operation %S"] 12 

I don't know how to interpret these messages.

bethandtownes commented 4 years ago

I reinstalled everything and have the correct version of dependencies. Still it's a no go. I think it's in a broken state right now.

kaiwk commented 4 years ago

I can't reproduce this error now, but I find another possible bug which is related to byte compiling. it seems emacs-aio can't be byte compiled correctly, so I try to disable it in the latest commit.

You can try to delete leetcode.elc(in elpa directory), and try again.

bethandtownes commented 4 years ago

I tried it but to no avail.

bethandtownes commented 4 years ago

It turns out that i can't login. It bounces back with a message "login failed" in the url debug. However, I double checked that my account and password entered are correct. Any idea what the problem might be?

bethandtownes commented 4 years ago

Could it be a problem of the user agent? How do I clear the cache?

kaiwk commented 4 years ago

That's weird. I can log in with auth-source, did you check your .authinfo.gpg(depend on your auth-sources)? There should be a line like below:

machine leetcode.com login <email> password <password>

I'm not sure if this is about cookie.

If you used the old version, you can clear the request.el cache by delete the cache dir.

For current version, you can execute url-cookie-list and press C-k to delete.

bethandtownes commented 4 years ago

Okay. I will try that. The current vscode-leetcode is not working properly..plus i am not a big fan of vscode.. this is the only alternative that I like..too sad that is does not work on my machine.. it could be that I use arch linux...

bethandtownes commented 4 years ago

I tried to clean the cache.. but it still does not work. soooo weird

bethandtownes commented 4 years ago

放弃了! 登不上!

kaiwk commented 4 years ago

I haven't take elisp error handling seriously by now, so if something went wrong, this package may not give any useful info.

I'll let the issue opening, in case that someone encountered the same problem.

bethandtownes commented 4 years ago

The source of the problem is that it cannot login correctly using the information I provided. I suspect that the request somehow got bounced back for some unknown reason.

bethandtownes commented 4 years ago

If you want a full url-debug trace, I can provide it here.

ShuoLearner commented 4 years ago

I cannot login as well. (from 0905 to current version) I’m working on Ubuntu 18, emacs 26.2

After recompiling leetcode.el, I see lots of warnings, reporting some unused symbols. Some of those symbols follow “let-if”.

I tried to remove all pairs of “()” directly following “let-if”. I could login, but couldn’t run “leetcode-try” or “leetcode-submit”.

Hope my experience may help.

Jason Sun notifications@github.com于2019年9月23日 周一19:30写道:

If you want a full url-debug trace, I can provide it here.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kaiwk/leetcode.el/issues/38?email_source=notifications&email_token=AAOSBM35HJ7YAC2TILOW2PTQLFGSLA5CNFSM4IY76X4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7MSKOA#issuecomment-534324536, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOSBMZIPBP2BJWOCQI5I5TQLFGSLANCNFSM4IY76X4A .

kaiwk commented 4 years ago

Hey guys, @jasonsun0310 @ShuoLearner

I think I have fixed the bug, we need (require 'subr-x) before we can use if-let, I have tested latest version(leetcode-20190924.353) with emacs -Q.

ShuoLearner commented 4 years ago

It works now! Thanks!

Wang Kai notifications@github.com于2019年9月24日 周二12:01写道:

Hey guys, @jasonsun0310 https://github.com/jasonsun0310 @ShuoLearner https://github.com/ShuoLearner

I think I have fixed the bug, we need (require 'subr-x) before we can use if-let, I have tested latest version(leetcode-20190924.353) with emacs -Q.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/kaiwk/leetcode.el/issues/38?email_source=notifications&email_token=AAOSBM73C6QOY4IKZUNIVP3QLI2XHA5CNFSM4IY76X4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7O4HCY#issuecomment-534627211, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOSBMZSCP7RYOMZWEFMAG3QLI2XHANCNFSM4IY76X4A .

bethandtownes commented 4 years ago

it still doesn't work on my end..

On Tue, Sep 24, 2019 at 5:52 PM Shuo Wang notifications@github.com wrote:

It works now! Thanks!

Wang Kai notifications@github.com于2019年9月24日 周二12:01写道:

Hey guys, @jasonsun0310 https://github.com/jasonsun0310 @ShuoLearner https://github.com/ShuoLearner

I think I have fixed the bug, we need (require 'subr-x) before we can use if-let, I have tested latest version(leetcode-20190924.353) with emacs -Q.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub < https://github.com/kaiwk/leetcode.el/issues/38?email_source=notifications&email_token=AAOSBM73C6QOY4IKZUNIVP3QLI2XHA5CNFSM4IY76X4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7O4HCY#issuecomment-534627211 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAOSBMZSCP7RYOMZWEFMAG3QLI2XHANCNFSM4IY76X4A

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kaiwk/leetcode.el/issues/38?email_source=notifications&email_token=AFIDNXOAVP56U2Q25IGD7SLQLKD3BA5CNFSM4IY76X4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7P5RZY#issuecomment-534763751, or mute the thread https://github.com/notifications/unsubscribe-auth/AFIDNXP2HIJXZGYAX3GZTX3QLKD3BANCNFSM4IY76X4A .

-- Daqian Sun

Tel:607-379-5149 Department of Mathematics Department of Economics Cornell University

kaiwk commented 4 years ago

@jasonsun0310 did you tried emacs -Q?

put this in *scratch* buffer, and eval-buffer.

(setq package-archives '(("gnu"   . "your gnu mirror")
                         ("melpa" . "your melpa mirror")))
(package-initialize)

Execute command package-reinstall leetcode, also try list-packages to see package version.

haoyuan80s commented 4 years ago

I tried the "emacs -Q" approach, but still fail to login. (I’m working on OSX, emacs 26.2)

@jasonsun0310 did you tried emacs -Q?

put this in *scratch* buffer, and eval-buffer.

(setq package-archives '(("gnu"   . "your gnu mirror")
                         ("melpa" . "your melpa mirror")))
(package-initialize)

Execute command package-reinstall leetcode, also try list-packages to see package version.