Closed shreyamalviya closed 1 year ago
This should be changed in the backend. If the mode is not recognised, the endpoint should return "unset".
If the mode is not recognized, something has gone horribly wrong. Who knows what other data has been corrupted. The backend should probably crash to avoid doing further damage.
Island modes were removed in #3400.
Describe the bug
If the frontend gets an unexpected Island mode from the backend (not "advanced", "ransomware", or "unset"), the configuration page crashes.
To Reproduce
Steps to reproduce the behavior:
mode
field insimulation_state.json
(in the data directory) to something other than "advanced", "ransomware", or "unset".Expected behavior
It shouldn't crash and should probably default to "unset" if the mode isn't recognised. This should be changed in the backend. If the mode is not recognised, the endpoint should return "unset". If this seems more like something that the frontend should handle, we should add the condition to the logic to set the mode as "unset" if it's not recognised.
Screenshots
https://user-images.githubusercontent.com/44770317/201920306-6d7d6890-e726-429c-b766-e0fcd3026236.mp4