Skip to content
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

Decrypt prompt disappears before I can type in the password #252

Open
cashpw opened this issue Jul 25, 2024 · 0 comments
Open

Decrypt prompt disappears before I can type in the password #252

cashpw opened this issue Jul 25, 2024 · 0 comments

Comments

@cashpw
Copy link

cashpw commented Jul 25, 2024

Problem:

The decrypt password prompt disappears before I can type in the password (1-2 seconds). The only output in *Messages* is:

Decrypting /<omitted>/.config/emacs/.local/cache/oauth2-auto.plist...0%

Solutions:

  1. Figure out why it's disappearing and fix the root issue

    I've tried for ~3 hours and don't want to put more time into it.

  2. Get and cache the access token outside of the =deferred= block!

(after!
  org-gcal

  (defun cashpw/org-gcal--get-access-token (&rest r)
    "Call `org-gcal--get-access-token' for the first calendar in the list."
    (org-gcal--get-access-token (car (car org-gcal-file-alist))))

  (advice-add 'org-gcal-sync :before #'cashpw/org-gcal--get-access-token)

  (defvar org-gcal--access-token nil
    "Set if a sync function is running.")

  (defun org-gcal--sync-unlock ()
    "Deactivate sync lock in case of failed sync."
    (interactive)
    (setq
     org-gcal--sync-lock nil
     org-gcal--access-token nil))

  (defun org-gcal--get-access-token (calendar-id)
    "Return the access token for CALENDAR-ID."
    (if org-gcal--access-token
        org-gcal--access-token
      (setq org-gcal--access-token
      (aio-wait-for (oauth2-auto-access-token calendar-id 'org-gcal))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant