Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modifying a copy of a project changes the original #3650

Open
Raizo62 opened this issue Oct 25, 2024 · 9 comments
Open

modifying a copy of a project changes the original #3650

Raizo62 opened this issue Oct 25, 2024 · 9 comments

Comments

@Raizo62
Copy link

Raizo62 commented Oct 25, 2024

Hi

I'm not sure if this is a bug.
I think I see where it's coming from, but it has a surprising effect.

  • With GNS3 2.2, i create a new projet ("untitle") with devices.

  • I close GNS3.

  • With Linux, i do a copy of this project with the name "untitle_copy"
    cp -R untitle untitle_copy

  • With GNS3, i want to modify the project "untitle_copy".

  • As in GNS3, in "Projects library", i don't see my copy, i force with the button "Open a project from disk" and i open it. (The title in GNS3 is "untitle")

  • I move the devices on this project.

  • I close GNS3.

  • With GNS3, I open the project "untitle".

  • Devices are also moved

@grossmj
Copy link
Member

grossmj commented Nov 26, 2024

With Linux, i do a copy of this project with the name "untitle_copy"
cp -R untitle untitle_copy

Hum, there is a project ID inside the .gns3 file, this means the project ID will be the same if you copy projects like that.

@Raizo62
Copy link
Author

Raizo62 commented Nov 26, 2024

I think also. But it gives a strange feeling : we don't expect that

@grossmj
Copy link
Member

grossmj commented Nov 26, 2024

Maybe we should check for duplicated project ID?

@Raizo62
Copy link
Author

Raizo62 commented Nov 26, 2024

Maybe we should check for duplicated project ID?

Okay, but then what do you do with your multiple project IDs ? How do you choose ?

@grossmj
Copy link
Member

grossmj commented Nov 26, 2024

Okay, but then what do you do with your multiple project IDs ? How do you choose ?

We could automatically generate a new project ID or warn users there are projects with duplicated IDs. Not sure it's worth doing anything...

@Raizo62
Copy link
Author

Raizo62 commented Nov 27, 2024

I don't understand something: When we choose a project (example A), GNS3 goes through all the projects to find the ID of A?

@grossmj
Copy link
Member

grossmj commented Nov 28, 2024

I don't understand something: When we choose a project (example A), GNS3 goes through all the projects to find the ID of A?

No, the projects info is loaded by the controller. Then when you select your project, GNS3 will use its ID to find in the list.

@Raizo62
Copy link
Author

Raizo62 commented Nov 28, 2024

So the controller loads all the projects (at least the IDs), and it selects the ID from this list.
So when we choose a project with the button "Open a project from disk", GNS3-gui sends the ID of the project to the controller which opens the projet with this ID ? It doesn't send the path ?

@muriloglix
Copy link

Okay, but then what do you do with your multiple project IDs ? How do you choose ?

We could automatically generate a new project ID or warn users there are projects with duplicated IDs. Not sure it's worth doing anything...

I see three possibilities:

  1. When importing the project, check for an existing ID and display a new window asking if the user wants to generate a new ID or cancel the operation.
  2. When importing a project, automatically generate a new ID and continue the import process.
  3. When importing a project, check if the ID already exists on the server. If found, generate a new ID and continue the import process.

I believe that the simplest would be option number 2, since, when importing, we can consider that it will be a "new project" on the server. This would simplify the code, since it would only generate a new ID, there would be no need to ask the client anything and there would be no need to check for duplicate IDs. Everything would work transparently for the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants