Skip to content

fix: invalid configurator state breaks "copy and edit this visualization" button#2596

Merged
mburri merged 3 commits into
mainfrom
fix/invalid-configurator-state
Jul 10, 2026
Merged

fix: invalid configurator state breaks "copy and edit this visualization" button#2596
mburri merged 3 commits into
mainfrom
fix/invalid-configurator-state

Conversation

@mburri

@mburri mburri commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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 measureId for MapSymbolLayers was declared as measureId: t.string in the type, but then the property gets unset in the reduces when the user selects "None" as measurement:

image

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 added a CHANGELOG entry
  • I made a self-review of my own code
  • I wrote tests for the changes (if applicable)
    - [ ] I wrote configurator and chart config migrations (if applicable)

@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
visualization-tool Ready Ready Preview, Comment Jul 9, 2026 11:38am

Request Review

@mburri mburri merged commit d90cc2d into main Jul 10, 2026
12 of 14 checks passed
@mburri mburri deleted the fix/invalid-configurator-state branch July 10, 2026 07:07
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.

2 participants