thesamim / TickTickSync

GNU General Public License v3.0
140 stars 8 forks source link

Login Failed #18

Closed SEANSHEASCHRIER closed 9 months ago

SEANSHEASCHRIER commented 9 months ago

Hello, I am getting a login failed, error even though I am sure my Ticktick Login Credentials are right.

Can you help?

Output of console: plugin:tickticksync:45730 login error: Probably timeout. eval @ plugin:tickticksync:45730 step @ plugin:tickticksync:45653 eval @ plugin:tickticksync:45600 eval @ plugin:tickticksync:45586 __awaiter @ plugin:tickticksync:45568 eval @ plugin:tickticksync:45722 self2.callback @ plugin:tickticksync:44316 emit @ node:events:513 Request.onRequestError @ plugin:tickticksync:44861 emit @ node:events:513 socketErrorListener @ node:_http_client:502 emit @ node:events:513 emitErrorNT @ node:internal/streams/destroy:151 emitErrorCloseNT @ node:internal/streams/destroy:116 processTicksAndRejections @ node:internal/process/task_queues:82 plugin:tickticksync:46443 Login Result: false plugin:tickticksync:46453 Login failed! initializeAPI @ plugin:tickticksync:46453 processTicksAndRejections @ node:internal/process/task_queues:95 await in processTicksAndRejections (async) initializePlugin @ plugin:tickticksync:48759 eval @ plugin:tickticksync:46254 (anonymous) @ app.js:1

thesamim commented 9 months ago

The only times I've seen this behavior is when TickTick was not reachable from my machine.

Please try this:

  1. Close Obsidian.
  2. Close your browser
  3. Re-open your browser
  4. Login to TickTick on browser
  5. If that worked, now open Obsidian again
  6. Got to Settings -> TickTickSync
  7. Click on the login button again

If that still fails, there may be an issue with how the plugin is trying to reach TickTick and we'll have to dive into it further.

MandeepCodes commented 9 months ago

@thesamim My login fails in Obsidian but is successful in browser.

Another observation that I see that might be causing issue image is that when I login in my browser there is a captcha pop-up.

thesamim commented 9 months ago

@MandeepCodes : Did you, at any point, see: plugin:tickticksync:45730 login error: incorrect_password_too_many_times in the console?

In trying to reproduce your situation, I tried logging in with a bad password. Got the above error message.

I changed the password three times. Was not able to login from the Web or from the App. I think there's a 24 hour lock or something. (Which incidentally is going to delay testing significantly! :) )

Anyway, I'd wait 24 hours and try again.

In one of the upcoming releases (not the next one, because that's already got some significant changes, probably the one following) I will add code to return more detail in these cases in case that helps.

thesamim commented 9 months ago

@MandeepCodes : there appears to be a ticktick issue. I have my real account, and accounts I test with. For all the accounts: after signing out, and trying to sign back in on the web, I'm not able to access my account.

MandeepCodes commented 9 months ago

Thank you for quick response. I would check after 24 hours. Will update the results back here.

radhakrisri commented 9 months ago

Seeing the same problem. Have changed my password twice already, but not able to get the plugin to login.

thesamim commented 9 months ago

@MandeepCodes , @radhakrisri , @SEANSHEASCHRIER : I'm not sure, but I think there's a system wide issue with TickTick. I am investigating.

MandeepCodes commented 9 months ago

Update : Been 24 hours sine I last changed password. image

thesamim commented 9 months ago

I'm having the same issue. I'm investigating. TickTick has made a breaking change apparently.

MandeepCodes commented 9 months ago

Another question : why we are not using OAuth in https://github.com/thesamim/ticktick-api-lvt recommended by APIs https://developer.ticktick.com/docs/index.html#/openapi?id=authorization image

thesamim commented 9 months ago

why we are not using OAuth

Because at the time of writing, this only supported their V1 API. Which is limited in functionality compared to the V2 API.

thesamim commented 9 months ago

@SEANSHEASCHRIER , @MandeepCodes , @radhakrisri : It would appear that TickTick has reverted whatever changes caused havoc with logins.

It's working for me again. BUT: It would appear that folks in different regions experienced different outcomes over the last couple of days. Please let me know your current status.

MandeepCodes commented 9 months ago

@thesamim yes its working now. From what I have observed is that Ticktick is flagging accounts that are trying multiple logins. image

Every time I open obsidian I get an email that someone logged in. So we need to find a way to maintain cache

radhakrisri commented 9 months ago

It seems to working on my end

On Fri, Jan 5, 2024, 8:07 AM Mandeep Singh @.***> wrote:

@thesamim https://github.com/thesamim yes its working now. From what I have observed is that Ticktick is flagging accounts that are trying multiple logins. image.png (view on web) https://github.com/thesamim/TickTickSync/assets/111353216/a5c8be50-0cfc-4948-9734-11ea78993160

— Reply to this email directly, view it on GitHub https://github.com/thesamim/TickTickSync/issues/18#issuecomment-1878734153, or unsubscribe https://github.com/notifications/unsubscribe-auth/A53JOY2RH5MLSOH43PHSYIDYNACJTAVCNFSM6AAAAABBGAFT4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZYG4ZTIMJVGM . You are receiving this because you were mentioned.Message ID: @.***>

thesamim commented 9 months ago

So we need to find a way to maintain cache

Issue created. Will implement after next update.

wildenrou commented 9 months ago

Hi, I am located in Canada and am receiving a notification telling me to "Please login from Settings" anytime I try to access a past note or other content generated with the editor. I am able to sign in from everywhere else and have double-checked my credentials. Thanks in advance for your support.

thesamim commented 9 months ago

I am able to sign in from everywhere else

What version of TickTickSync are you on? If you've not updated to 1.0.9, could you please do so and let me know what happens?

thesamim commented 9 months ago

@wildenrou, @MandeepCodes, @radhakrisri, @SEANSHEASCHRIER : Could you please test with release 1.0.9 and let me know your results?

Thanks.

radhakrisri commented 9 months ago

@wildenrou, @MandeepCodes, @radhakrisri, @SEANSHEASCHRIER : Could you please test with release 1.0.9 and let me know your results?

Thanks.

I've updated to 1.0.9. I was able to login when prompted. But yet, I see the notifications prompting me to login show up. Looks like something is still amiss?

thesamim commented 9 months ago

Looks like something is still amiss?

Could you please turn on debug mode and send me console log?

radhakrisri commented 9 months ago

Looks like something is still amiss?

Could you please turn on debug mode and send me console log?

This is what I see in Developer Console.

image

Any other folders I should look into, for logs?

thesamim commented 9 months ago

Any other folders I should look into, for logs?

If you could please go to .obsidian\plugins\tickticksync\data.json At the bottom of the file, you will see:

  "version": "1.0.9",
  "username": <your email address>,
  "token": 

Could you please let me know if your version number and username match your expectations and if the token field contains a long hexadecimal string?

radhakrisri commented 9 months ago

Any other folders I should look into, for logs?

If you could please go to .obsidian\plugins\tickticksync\data.json At the bottom of the file, you will see:

  "version": "1.0.9",
  "username": <your email address>,
  "token": 

Could you please let me know if your version number and username match your expectations and if the token field contains a long hexadecimal string?

Yes, they look fine to me.

radhakrisri commented 9 months ago

Btw, noticed that the password is stored in plain text. Need to scramble this out. Created #29 for the same.

thesamim commented 9 months ago

If you are comfortable doing so:

  1. Please go to <root of your vault>\.obsidian\plugins\tickticksync\
  2. make a copy of main.js
  3. extract the attached main.js and copy it to <root of your vault>\.obsidian\plugins\tickticksync\
  4. Try loging in again.

This has better debugging output. It might give me a clue what's going on.

Please ignore the drop down for choosing a server. I have only tested with ticktick.com (which I believe is what you are using anyway...)

main.zip

radhakrisri commented 9 months ago

That seems to have worked image

Do you want the IncomingMessage content?

thesamim commented 9 months ago

Do you want the IncomingMessage content?

If it's working for you, then I have a pretty good idea what happened. I'll wait to hear what's going on with Dida testing then release this branch ASAP.

Thanks for your support in figuring this out.

quanru commented 9 months ago

How about try this kind of login manner: https://github.com/viduycheung/ticktick-obsidian/blob/main/main.ts#L401

thesamim commented 9 months ago

How about try this kind of login manner: https://github.com/viduycheung/ticktick-obsidian/blob/main/main.ts#L401

Because this is only supported in V1 version of the API: See the request call here

The V1 version of the API does not support all the functionality of a full sync.