GoogleContactsEventsNotifier icon indicating copy to clipboard operation
GoogleContactsEventsNotifier copied to clipboard

Runtime permissions lost after >7 days, permissions need to be regranted

Open FLAGEL opened this issue 1 year ago • 12 comments

Steps to reproduce

  1. Follow instructions documented in "Installation and setup" (https://github.com/GioBonvi/GoogleContactsEventsNotifier/blob/master/docs/install-and-setup.md).
  2. Run the script. A pop-up box titled "Authorization required" appears. Bread text is "This project requires your permission to access your data". Press "Review permissions" and select account to use. You will face a page with the content "Google hasn’t verified this app. You’ve been given access to an app that’s currently being tested. You should only continue if you know the developer that invited you". Press "Continue" and "Allow". Script will run and produce output as intended.
  3. More than a week later (Google Scripts seems to only keep logs for 7 days), but not more than a month later, step 2 above needs to be repeated for the script to keep running. The behaviour is reoccurring and does not stop after n times.

Expected behaviour

Permissions (step 2 above) should be given once and stay until revoked. While I understand that this is likely related to Google Apps Scripts as a service and not Google Contacts Events Notifier, if this is expected behaviour, it would be wise to include a note on it in the installation documentation.

Context

  • Version of the script: 5.1.4

Lastly, I want to extend a big thank you to the author and all contributors for their efforts - this is a great little script!

FLAGEL avatar Apr 18 '23 11:04 FLAGEL

Same Problem!

BobBruni avatar Mar 21 '24 09:03 BobBruni

I am not sure what is going on there. I was not able to reproduce this.

If anyone is willing to take a closer look, feel free!

plainerman avatar Mar 22 '24 09:03 plainerman

Same problem, test execution works, run notifyStart - permissions granted, trigger is created, 7 days later no notifications anymore, trigger last executed on 1.04. Running notifyStart requires to grant permissions again, which should not happen as far as I understand

chpasha avatar Apr 07 '24 18:04 chpasha

I have observed the execution for a week and today, exactly a week after activation, the script didn't run any more. Executing notifyStart brought me again to the consent screen where I had to grant all those permissions for the script :-(

P. S. perhaps this is the reason https://stackoverflow.com/questions/66857421/why-my-google-apps-script-permissions-are-revoked-after-few-days

Authorizations by a test user will expire seven days from the time of consent. If your OAuth client requests an offline access type and receives a refresh token, that token will also expire.

chpasha avatar Apr 15 '24 06:04 chpasha

I noticed, that my project status is test in google cloud platform, I've choosen "publish", let's see if it was it image

chpasha avatar Apr 15 '24 06:04 chpasha

That is a great find. Please keep us in the loop!

plainerman avatar Apr 15 '24 14:04 plainerman

unfortunately, that didn't work, yesterday the script ran for the last time and today no more. I will keep googling :-(

chpasha avatar Apr 23 '24 06:04 chpasha

That is unfortunate. I was checking it on my (working) configuration and the project status is set to test. Thank you for looking into this!

plainerman avatar Apr 23 '24 07:04 plainerman

As for now I was not able to reproduce the issue. I set up the script about a year ago (after the last update I applied) and didn't have to re-grant any permission after that.

baatochan avatar Apr 23 '24 12:04 baatochan

try to create and assign a new project, I also had no issues for a long time until something broke and I've started to change things and finally created and assigned a new project instead of some default one

chpasha avatar Apr 23 '24 12:04 chpasha

I've managed to make it work longer than a week. There is a possiblity to "release" a script (I don't know the exact english version of this button, it is in the top right corner, where versions are managed). So I created a "version" of the script, deleted the trigger for test version and created manually one for "released" version. Since then, it is running.

chpasha avatar May 06 '24 06:05 chpasha

I've managed to make it work longer than a week. There is a possiblity to "release" a script (I don't know the exact english version of this button, it is in the top right corner, where versions are managed). So I created a "version" of the script, deleted the trigger for test version and created manually one for "released" version. Since then, it is running.

Thanks for the pointer, I am trying it out now. Hopefully iy works! :-)

For anyone else reading this, the "release" mentioned by chpasha is "Deploy" in English.

FLAGEL avatar Jun 27 '24 20:06 FLAGEL