azai91/alfred-drive-workflow

Issue w/ Creating New Google Doc (doc, sheets, or anything)

Jawwads opened this issue · 2 comments

@azai91, I usually get this notification when I try to create a new doc;
image

Sometimes it works in creating the new doc and sometimes it gives me the above. Any idea what is going on?

I had this happen as well and I had to re-run d > login to fix the issue.

I could still search and open documents because this was (presumably) using cached data.

I looked at the code and the problem is that the access token does not get refreshed.

As a quick fix I inserted cls.refresh() just above this line.

I say it is a “quick fix” because refreshing an access token should only be done when the access token has expired, so there is minor performance overhead by always refreshing it, and maybe Google will even throttle you, if you create thousands of new documents :)