DLR-SC / ESID

This is the repository to the ESID frontend for visualization of infectious disease propagation.
Apache License 2.0
15 stars 3 forks source link

Fix site crash when scenario was deleted from DB #329

Closed JonasGilg closed 4 months ago

JonasGilg commented 5 months ago

Description

Fixes an issue with the persistent store when a scenario is deleted from the database (scenario ID returns 500 on API fetch). This issue ocurrs when the redux store still has the scenario id cached in the activeScenarios and scenarioList and the Simulation Chart or Data Cards try to fetch data with this scenario id from the API. To fix this, IDs in the activeScenarios are ignored if the ID is not in the sceanrioList. Additionally the scenarioList is not persisted and fetched newly on every load.

Checklist

I, the author of this PR checked the following requirements for good software quality:

I, the reviewer checked the following things:

github-actions[bot] commented 5 months ago

Unit Test Results

  1 files  +  1  14 suites  +14   51s :stopwatch: +51s 32 tests +32  32 :heavy_check_mark: +32  0 :zzz: ±0  0 :x: ±0  33 runs  +33  33 :heavy_check_mark: +33  0 :zzz: ±0  0 :x: ±0 

Results for commit 6f8eac92. ± Comparison against base commit b1befd55.

:recycle: This comment has been updated with latest results.

NXXR commented 5 months ago

@annawendler can you checkout this branch and see if it fixes your issue with the updating scenario?

annawendler commented 5 months ago

I still have the issue, when I update the scenario I get the error message "Uncaught TypeError: theme.custom.scenarios[props.scenario.id] is undefined".

annawendler commented 5 months ago

Now the display works after updating the scenario without clearing the cache. However, when I click on the scenario to view the uncertainties the site goes blank. If I remember correctly this worked before but I'm not sure or if this is a different issue. image

JonasGilg commented 5 months ago

Now the display works after updating the scenario without clearing the cache. However, when I click on the scenario to view the uncertainties the site goes blank. If I remember correctly this worked before but I'm not sure or if this is a different issue. image

Ok, I think I fixed this too. Please try again.

annawendler commented 5 months ago

It's working now! The only thing is that now the colors of the uncertainties aren't matching with the line of the scenario anymore. image

JonasGilg commented 5 months ago

It's working now! The only thing is that now the colors of the uncertainties aren't matching with the line of the scenario anymore. image

This should be fixed as well. We will rework how scenarios are colored in the future, since we currently assume that the scenarios have rising ids starting from 1. See #330.

annawendler commented 5 months ago

It is fixed now.

github-actions[bot] commented 4 months ago

Test Results

34 tests  ±0   34 :white_check_mark: ±0   5s :stopwatch: ±0s 15 suites ±0    0 :zzz: ±0   1 files   ±0    0 :x: ±0 

Results for commit 700c81f2. ± Comparison against base commit 59ea85db.