I have created a simple slash command in Slack which retrieves some data from a google sheet. The sheet extension is deployed as a web app and works fine, there is no code error. However, after about a week, the slash command no longer works and returns a "dispatch failed" error. To fix, I have to redeploy the web app (keeping the same URL). Again, it works fine for a week or so then fails with the same error. Is there a way that I can avoid having to do this and get the web app to work permanently?
Google sometimes regularly(about a week) revokes granted authorization for webapps(probably as a security measure). To reduce automatic revokations, reduce the scopes used by the script:
Use @OnlyCurrentDoc
, when only access to one document is needed
Reduce the number of unverified apps in your account
Reduce the number of users accessing your webapp
Try changing to a new GCP and/or try configuring a Oauth consent screen with test users
if all else fails, you may need to verify your app with Google