4 ms·
I built a Google Apps Script Gmail add-on (with a UI and card view for a selected email) for archiving email contents as a PDF to an internal enterprise documen
by Edman274 5y ago
I built a Google Apps Script Gmail add-on (with a UI and card view for a selected email) for archiving email contents as a PDF to an internal enterprise document system using GAS and AWS API Gateway. Here are two extremely annoying problems that I really can't fix using this platform:
1. Calls to UrlFetchApp.fetchAll() will fail with an "Unexpected Error" exception about every 3 to 8 percent of calls. The way my code works is that I'll make one GET request to an AWS API Gateway endpoint to request a pre-signed S3 URL, and then I'll use the pre-signed S3 url to PUT a document. The unauthorized first request will fail sometimes, and issuing a PUT to the pre-signed S3 url will fail sometimes too. I have found no reason that these requests should fail, so instead of torturing myself by trying to figure out the root cause, I've decided to wrap both fetchAll() calls in a loop that retries the exact same request three times before giving up. If there was anything wrong with the request itself, one would expect a retry loop to be pointless, but it's significantly reduced the number of add-on failures.
2. If an email has invalid SPF alignment, then the add-on won't run at all. It's been three years and there's still no workaround for this. I have had to explain to dozens of people over the past three years that there's nothing I can do about it. https://issuetracker.google.com/issues/112064778 https://issuetracker.google.com/issues/112064778 .
I feel like Google Apps Script - especially Gmail add-ons - are sorely neglected and are treated as an annoying legacy product that will probably be discontinued very soon with no replacement.
- saagarjha 5y agoYeah, I found that UrlFetchApp.fetch had similarly weird issues–I got a lot of sporadic “Address unavailable” errors out of it.
- agentdrtran 5y agoYes, it's incredibly annoying how little attention it seems to get from google. Bugs sit in the bug tracker for years and while I like the redesign it broke a function I used (to get the current URL so create multi-page apps). Apps Script just got a new UX update not long ago which I took as a good sign but App Maker had a roadmap going out a year when it got killed, so.