[Bug Report] Studio can have a duplicated StashID attached
Describe the bug Studios are able to get into a state where they have a duplicate StashID attached to them. When attempting to clean that up using the delete button beside one of them, it deletes both. However I don't think deleting both is really the bug here, the bug is more than it can get in this state at all.
To Reproduce I'm not sure what normal workflow leads to this case, so the best way I can reproduces is via the playground. Steps to reproduce the behavior:
- Go to
/playground - Add the mutation as:
mutation Studio($input: StudioUpdateInput!) {
studioUpdate(input: $input) {
id
name
url
stash_ids {
endpoint
stash_id
}
updated_at
}
}
- Pasting in the ID of the studio you would like to test with, use variables like:
{
"input": {
"id": 571,
"stash_ids": [
{
"endpoint": "https://stashdb.org/graphql",
"stash_id": "this-is-a-fake-id"
},
{
"endpoint": "https://stashdb.org/graphql",
"stash_id": "this-is-a-fake-id"
}
]
}
}
- Navigate to your test studio in stash and click edit, you will see the duplicated id attached:
Expected behavior If a flow attempts to add a duplicate stashid, it would be skipped (probably no need to throw an error since the object is already in the intended state)
Screenshots

Stash Version: (from Settings -> About): v0.16.1-1-gcba0fddf
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome
- Version 103.0.5060.134 (Official Build) (arm64)
Additional context N/A