with details of every defence type for every level. Which is large (442 lines, 26570 characters).
4 calls to openai/model all of which return the currently selected model and its config values. [notable these aren't returned in the main reset call]
health returns 200 (when backend is up).
email/get?level=3 returns the emails for level 3. But obviously they've just been reset, so it returns an empty array.
openai/history?level=3 returns the chat history for level 3. But obviously they've just been reset, so it returns an empty array.
defence/status?level=3 returns the configured values for level 3 defences. But these are already contained in the response to reset.
If resetting all progress on level 1, you get the above calls but without the calls to openai/model.
🔧 This should all be combined into one request without all the repetition.
AC:
GIVEN frontend in preview mode (so that react doesn't do its double render thing) npm run preview
AND any level
WHEN the user resets all progress
THEN there should be only one api call made of type fetch
Here's how you quickly find out what api calls are being made that are fetch type. Note that the CombinedFonts call is of type xhr, therefore we ignore it.
Here's what happens when I reset all progress on Sandbox:
reset
resets then returns entirelevelState
property of the session, which looks like:with details of every defence type for every level. Which is large (442 lines, 26570 characters).
openai/model
all of which return the currently selected model and its config values. [notable these aren't returned in the mainreset
call]health
returns 200 (when backend is up).email/get?level=3
returns the emails for level 3. But obviously they've just been reset, so it returns an empty array.openai/history?level=3
returns the chat history for level 3. But obviously they've just been reset, so it returns an empty array.defence/status?level=3
returns the configured values for level 3 defences. But these are already contained in the response toreset
.If resetting all progress on level 1, you get the above calls but without the calls to
openai/model
.🔧 This should all be combined into one request without all the repetition.
AC:
GIVEN frontend in preview mode (so that react doesn't do its double render thing)
npm run preview
AND any level WHEN the user resets all progress THEN there should be only one api call made of type fetchHere's how you quickly find out what api calls are being made that are fetch type. Note that the CombinedFonts call is of type xhr, therefore we ignore it.