Editing an insight with an ID that wasn't derived from the title creates a duplicate insight instead of maintaining the ID
Created by: felixfbecker
Noticed this on sourcegraph.com.
- Say you have an insight in settings, and you manually change the ID to your liking, or you create a new insight from the settings directly without the UI and pick a custom ID. (In our case, we had an old existing insight).
- You go to the dashboard and edit that insight, and save your changes.
Expected
The insight under the old ID was edited.
Actual
There is now a second duplicate insight using the ID derived from the title, but otherwise equal/reflecting your changes.
When trying edit the first insight again, it now immediately fails validation on the title with "An insight with this title already exists" (which is true, as a duplicate was created by the UI).