Hello Guys,
Yesterday I was trying to make glide triggers doPost webApp in google sheet script. it worked just fine but it got called multiple times, and after some research i found this
mentioning the
Webhook action
hookKind
is the stringapp-action
.appID
is the calling app’s ID.idempotencyKey
is a unique string identifying the webhook request. Webhooks will be retried if they fail, but it is possible that webhooks will be called with the same invocation more than once in very rare circumstances. You may use theidempotencyKey
to ensure you only service the request exactly once.timestamp
is the approximate date/time when the action was triggered.params
is an object containing one field per argument passed to the API column. Its format is described below.Glide will try a webhook endpoint up to five times to improve delivery reliability. The response body is ignored, but HTTP status codes are respected. HTTP 2xx is treated as a success, HTTP 3xx is respected and followed, and all other statuses, including socket connection failures, are treated as failures and are eligible for retrying.
Retries occur on an exponential backoff schedule, but attempt timing is not precise. You may expect retries to follow this schedule with up to two additional minutes of delay:
Failed attempts Retry after 1 2 minutes 2 4 minutes 3 8 minutes 4 16 minutes 5 never
I couldnt get it to stop retrying even though I tried the following in google app script
return ContentService.createTextOutput(JSON.stringify({ 'status': 'success' }))
.setMimeType(ContentService.MimeType.JSON);
after several tries I used idempotencyKey to prevent duplicate handling of the tries until it stops from glide side.
var cache = CacheService.getScriptCache();
// Check if this request has been processed before
//this will solve glide triggering the API multitple times
if (cache.get(data.idempotencyKey)) {
// This request has been processed before, so we can ignore it
return;
}
cache.put(data.idempotencyKey, 'processed', 21600);
I know this is a bad solution but I couldn’t get glide to stop retrying.
Any suggestions?