johandebeurs / alfred-mstodo-workflow

Fast task entry, searching and completion for Microsoft Todo via Alfred 4/5
MIT License
138 stars 4 forks source link

PassWordNotFound error #23

Closed jwvdm closed 1 year ago

jwvdm commented 3 years ago

Thank you for your work on this plugin!

I am experiencing some form of authentication issue, possibly related to the refreshing of tokens. The plugin, which was working previously, now returns an error "Error in Workflow 'Microsoft ToDo".

I am attaching output from the debugging console. I've previously managed to resolve this issue by calling _td-full-reset and re-authenticating. This seems to happen approx every two weeks.

[11:47:13.176] Microsoft ToDo[Script Filter] Queuing argument ''
[11:47:13.443] Microsoft ToDo[Script Filter] Script with argv '(null)' finished
[11:47:13.446] ERROR: Microsoft ToDo[Script Filter] Code 1: .
2021-01-29 11:47:13,369 workflow     ERROR    
Traceback (most recent call last):
  File "[deleted]/Alfred/Alfred.alfredpreferences/workflows/user.workflow.AC2B9BB1-5C52-48FD-8747-71D533C446FA/workflow/workflow.py", line 2073, in run
    func(self)
  File "alfred-mstodo-workflow.py", line 17, in main
    route(wf.args)
  File "[deleted]/Alfred/Alfred.alfredpreferences/workflows/user.workflow.AC2B9BB1-5C52-48FD-8747-71D533C446FA/mstodo/handlers/route.py", line 18, in route
    logged_in = is_authorised()
  File "[deleted]/Alfred/Alfred.alfredpreferences/workflows/user.workflow.AC2B9BB1-5C52-48FD-8747-71D533C446FA/mstodo/auth.py", line 57, in is_authorised
    return resolve_oauth_token(refresh_token=workflow().get_password(config.KC_REFRESH_TOKEN))
  File "[deleted]/Alfred/Alfred.alfredpreferences/workflows/user.workflow.AC2B9BB1-5C52-48FD-8747-71D533C446FA/workflow/workflow.py", line 2445, in get_password
    account, '-g')
  File "[deleted]/Alfred/Alfred.alfredpreferences/workflows/user.workflow.AC2B9BB1-5C52-48FD-8747-71D533C446FA/workflow/workflow.py", line 2813, in _call_security
    raise PasswordNotFound()
PasswordNotFound
johandebeurs commented 3 years ago

Interesting - There may be a race condition / uncaught exception in refreshing the auth tokens for the application. Can you let me know

jwvdm commented 3 years ago

I'll check the keychain next time this happens and get back to you.

I can't say I was doing anything special in terms of steps to reproduce. Basically the plugin works as normal for some time (might be around 14 days) and then stops working when I try to add a ToDo at some point.

yowie commented 1 year ago

I'm getting the same error. I fix it by deleting the two items from the keychain and re-doing the login flow.

johandebeurs commented 1 year ago

Auth has been refactored in release 0.2.0 which should resolve this issue