Skip to content

Commit

Permalink
Update src/web5-connect/web5-connect-server.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Liran Cohen <[email protected]>
  • Loading branch information
thehenrytsai and LiranCohen authored Jul 3, 2024
1 parent 1479a22 commit 747c4cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/web5-connect/web5-connect-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down

0 comments on commit 747c4cc

Please sign in to comment.