Fix crash when stored playground language state is invalid#3646
Fix crash when stored playground language state is invalid#3646martin-henz wants to merge 6 commits into
Conversation
Validate the stored chapter+variant combination against ALL_LANGUAGES when loading from localStorage. Falls back to the default language config if the combination is invalid (e.g. chapter 1 + explicit-control). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
RichDom2185
left a comment
There was a problem hiding this comment.
This works but behaves differently than what the issue suggests.
Coverage Report for CI Build 24697879728Coverage increased (+0.02%) to 40.826%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
In what way is this different from what the issue suggests? |
The issue suggests:
But the logic implemented is:
|
Hmm, the implementation checks: so it looks for a valid combination. It falls back on the default lang/variant only if the combination is not valid. |
AI-generated PR, fixing #3645
Generated with Claude Code, Sonnet 4.6.
Description
Validate the stored chapter+variant combination against ALL_LANGUAGES when loading from localStorage. Falls back to the default language config if the combination is invalid (e.g. chapter 1 + explicit-control).
Type of change
How to test
Start frontend using localhost, switch to conductor in feature flags, choose Source 1. Then reload in the browser. This would crash the frontend when the feature flag is reset to false, because the "Source 1" language does not have a CSE machine implementation.
Checklist