fix: invalid configurator state breaks "copy and edit this visualization" button#2596
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hupf
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For this visualization: https://int.visualize.admin.ch/en/v/xyBVyFkko--k?dataSource=Int
If the user clicks "copy and edit this visualization", the editor quickly loads, but the user then gets redirected to the app index page.
The console shows an error: Error while decoding configurator state
The problem was, that the property
measureIdforMapSymbolLayerswas declared asmeasureId: t.stringin the type, but then the property getsunsetin the reduces when the user selects "None" as measurement:In this case, the property was completely removed from the symbol layer - which then broke decoding. Decoding only happens when a config is reopened for editing, but not when the visualization is shown.
Making the measureId property optional fixed the issue.
I transferred the exact same view config to the preview deployment: https://visualization-tool-git-fix-invalid-co-9d0f93-visualize-admin-ch.vercel.app/en/v/xyBVyFkko--k?dataSource=Int
The copy and edit button now works with existing visualizations, no config migration is needed.
- [ ] I wrote configurator and chart config migrations (if applicable)