ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.26k stars 746 forks source link

Duplicate functionality for Environments saves incorrect values #7758

Open OptimusPi opened 3 days ago

OptimusPi commented 3 days ago

Product

Nitro

Version

22.0.0

Link to minimal reproduction

https://hotchocolategraphql.slack.com/archives/C02A2NX3WAH/p1732288751665649?thread_ts=1732228494.399289&cid=C02A2NX3WAH

Steps to reproduce

  1. Create Environment A
  2. Set a variable "LetterName" and value "A"
  3. Duplicate Environment A
  4. Set the "LetterName" value "B"
  5. Save as Environment B
  6. Save and Synchronize Workspace
  7. Log out log in again

You can see the value is the same on both environments but it should not be!

  1. Duplicate B
  2. Set value to "C" and save as Environment C
  3. Save and synchronize workspace
  4. Log out and log in again

You can see the value of all environments is "C"!

p.s. I didn't try a lot of things such as document, folder, API. Just Environments. I think it's copying the ID during Duplicate functionality

What is expected?

When Duplicating an environment, the values are the same. When saving as a new Title for the Environment, the values should be able to be changed without editing the original Environment values.

What is actually happening?

When Duplicating an environment, the values are the same. When saving as a new Title for the Environment, the values can be changed and Nitro is saving the new values to both environments, as if they are linked by the same unique ID. This bug made me lose work and have to re-do everything on the original environment I Duplicated.

Relevant log output

Additional context

I left a Slack message, Rafael said "thx will fix it". 👍 Look in the #Nitro channel or this link hopefully works: https://hotchocolategraphql.slack.com/archives/C02A2NX3WAH/p1732288751665649?thread_ts=1732228494.399289&cid=C02A2NX3WAH

I just created this issue for you to help you track it. Thank you! 👍

Here is also the attached screen recording https://github.com/user-attachments/assets/6f8f8f64-acc1-40ca-8fc3-2628cf978454