From ad932839c60cfb84c3e35a2e0796dd8d4177ae26 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Thu, 18 Aug 2022 16:53:06 -0400 Subject: [PATCH] Fixed guest token purging --- src/fetch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fetch.ts b/src/fetch.ts index dd197a6..f78309e 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -123,7 +123,7 @@ export const fetchUsingGuest = async ( /* We'll usually only hit this if we get an invalid response from Twitter. It's uncommon, but it happens */ console.error('Unknown error while fetching conversation from API'); - event && event.waitUntil(cache.delete(guestTokenRequestCacheDummy)); + event && event.waitUntil(cache.delete(guestTokenRequestCacheDummy.clone())); newTokenGenerated = true; continue; } @@ -135,7 +135,7 @@ export const fetchUsingGuest = async ( /* Running out of requests within our rate limit, let's purge the cache */ if (remainingRateLimit < 20) { console.log(`Purging token on this edge due to low rate limit remaining`); - event && event.waitUntil(cache.delete(guestTokenRequestCacheDummy)); + event && event.waitUntil(cache.delete(guestTokenRequestCacheDummy.clone())); } if (