Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: do not persist STDCM configuration #10381

Merged
merged 2 commits into from
Jan 17, 2025
Merged

front: do not persist STDCM configuration #10381

merged 2 commits into from
Jan 17, 2025

Conversation

emersion
Copy link
Member

@thibautsailly has confirmed that restoring the STDCM form values wasn't desirable when opening a new STDCM window.

Fixes crashes when reading an old local storage with data which doesn't conform to the new types.

@emersion emersion requested a review from a team as a code owner January 14, 2025 16:39
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Jan 14, 2025
@emersion emersion self-assigned this Jan 14, 2025
Copy link
Contributor

@RomainValls RomainValls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…tate

Using localStorage here is a bit of a hack: we don't actually want
to persist anything on disk. This also doesn't work when multiple
STDCM tabs are opened: launch 2 simulations, go back to the first
one, click the "Start a new query from the current one" button,
and the state of the second tab gets restored.

Instead, use a global variable to pass the form state to the new
window.

Signed-off-by: Simon Ser <[email protected]>
@thibautsailly has confirmed that restoring the STDCM form values
wasn't desirable when opening a new STDCM window.

Fixes crashes when reading an old local storage with data which
doesn't conform to the new types.

Signed-off-by: Simon Ser <[email protected]>
Copy link
Contributor

@clarani clarani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, not tested

@emersion emersion added this pull request to the merge queue Jan 17, 2025
Merged via the queue into dev with commit 00df2a1 Jan 17, 2025
27 checks passed
@emersion emersion deleted the emr/stdcm-no-persist branch January 17, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants