Skip to content

Fix crash when stored playground language state is invalid#3646

Open
martin-henz wants to merge 3 commits intomasterfrom
invalidLang
Open

Fix crash when stored playground language state is invalid#3646
martin-henz wants to merge 3 commits intomasterfrom
invalidLang

Conversation

@martin-henz
Copy link
Member

@martin-henz martin-henz commented Mar 10, 2026

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

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

  • I have tested this code
  • I have updated the documentation

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>
Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

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

This works but behaves differently than what the issue suggests.

@coveralls
Copy link

coveralls commented Mar 10, 2026

Pull Request Test Coverage Report for Build 22934474185

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 41.207%

Totals Coverage Status
Change from base Build 22914760717: 0.02%
Covered Lines: 5422
Relevant Lines: 12215

💛 - Coveralls

@martin-henz
Copy link
Member Author

This works but behaves differently than what the issue suggests.

In what way is this different from what the issue suggests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants