From e2d0c67a86ab727f3236a5b065400ee9be55ae05 Mon Sep 17 00:00:00 2001 From: Emma Mansell <73774046+7emansell@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:28:59 -0500 Subject: [PATCH 1/3] Updating timeout --- CHANGELOG.md | 7 +++++++ app/src/utils/api.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eec82d5b..ceb2dea8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased + +## [0.2.3] 2024-11-21 + +### Updated + +- Update timeout on API request to 14 seconds + ## [0.2.2] 2024-11-20 ### Updated diff --git a/app/src/utils/api.ts b/app/src/utils/api.ts index cba2c1e9..faa1bde9 100644 --- a/app/src/utils/api.ts +++ b/app/src/utils/api.ts @@ -195,7 +195,7 @@ export const apiResponse = async ( apiUrl += queryString; } - const timeout = 7000; + const timeout = 14000; const fetchWithTimeout = (url: string, opts: RequestInit) => { return Promise.race([ From 7170edf1c8467310b9056066172ddcea6a28d3aa Mon Sep 17 00:00:00 2001 From: Emma Mansell <73774046+7emansell@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:31:20 -0500 Subject: [PATCH 2/3] Test as well --- app/src/utils/api.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/utils/api.test.tsx b/app/src/utils/api.test.tsx index 3bd02967..e12f3b9b 100644 --- a/app/src/utils/api.test.tsx +++ b/app/src/utils/api.test.tsx @@ -168,7 +168,7 @@ describe("apiResponse", () => { const apiCall = apiResponse(mockApiUrl); - jest.advanceTimersByTime(7000); + jest.advanceTimersByTime(14000); await expect(apiCall).rejects.toEqual( new Error("apiResponse: Request timed out") From 242d9912f2e4476c08507d790aa482392f3f777c Mon Sep 17 00:00:00 2001 From: Emma Mansell <73774046+7emansell@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:33:21 -0500 Subject: [PATCH 3/3] Test correction --- app/src/utils/api.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/utils/api.test.tsx b/app/src/utils/api.test.tsx index e12f3b9b..7e3ed081 100644 --- a/app/src/utils/api.test.tsx +++ b/app/src/utils/api.test.tsx @@ -175,5 +175,5 @@ describe("apiResponse", () => { ); jest.useRealTimers(); - }, 10000); + }, 20000); });