From 747c4cc0368f39ba457e52170cf5a63b75f09d6a Mon Sep 17 00:00:00 2001 From: Henry Tsai Date: Wed, 3 Jul 2024 10:20:34 -0700 Subject: [PATCH] Update src/web5-connect/web5-connect-server.ts Co-authored-by: Liran Cohen --- src/web5-connect/web5-connect-server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web5-connect/web5-connect-server.ts b/src/web5-connect/web5-connect-server.ts index dc1ee40..0a6a065 100644 --- a/src/web5-connect/web5-connect-server.ts +++ b/src/web5-connect/web5-connect-server.ts @@ -110,9 +110,9 @@ export class Web5ConnectServer { const response = await this.cache.get(`response:${state}`); // Delete the Response object from the cache once it has been retrieved. - // IMPORTANT: only delete if object is fetched, otherwise there could be a race condition - // where the object is not fetched in this call but become available immediately right, - // we would end up deleting it before a successful fetch. + // IMPORTANT: only delete if the object exists, otherwise there could be a race condition + // where the object does not exist in this call but becomes available immediately after, + // we would end up deleting it before it is successfully retrieved. if (response !== undefined) { this.cache.delete(`response:${state}`); }