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

Always generate base environment id when importing #4378

Merged
merged 5 commits into from
Nov 30, 2022

Conversation

vincendep
Copy link
Contributor

@vincendep vincendep commented Jan 17, 2022

changelog(Fixes): Fixed an issue that caused dangling base environments when importing an Insomnia collection

This pull request ensures the "regeneration" of the base environment id when importing a collection.
Preventing the creation of an additional base environment, will be possible to import into an existing collection (modifying the export file) without losing all the exported environments .

Closes #4178

@vercel vercel bot temporarily deployed to Preview January 17, 2022 19:29 Inactive
@vincendep vincendep marked this pull request as draft January 17, 2022 20:26
@filfreire filfreire added the insomnia-stream a good candidate to look at during the weekly livestream (see #stream on https://chat.insomnia.rest) label Mar 29, 2022
@filfreire
Copy link
Member

Possibly linked with #3112

@vincendep
Copy link
Contributor Author

vincendep commented Jul 8, 2022

Hi @dimitropoulos and @filfreire . I just saw the stream and I'll try to clarify.
I was trying to replace the base environment _id property with the placeholder (and therefore also the parentId property of subenvironments since they have a parent-child relation) thus, in case of manually editing the workspaceId in the export file, the right id would be picked during the import phase.

Said that, this code is buggy and so the draft status. Also I don't know if actually make sense to support such a usecase of manually editing the export file, given that now is also present a functionality to import into an existing workspace.

@filfreire filfreire requested a review from a team November 29, 2022 17:34
@filfreire filfreire removed the insomnia-stream a good candidate to look at during the weekly livestream (see #stream on https://chat.insomnia.rest) label Nov 29, 2022
@filfreire
Copy link
Member

heads up @Kong/team-insomnia I added a unit test that reproduced the previous faulty behavior. The edge case was such that when reimporting we would end up with dangling environments which the user could no longer interact with.

@filfreire
Copy link
Member

@vincendep thanks for contributing this and sorry for the long wait on the merge. In the meantime I added tests 👍

This will go in the next release.

@vincendep
Copy link
Contributor Author

Hi @filfreire. No problem, happy to contribute. 😁

pavkout pushed a commit to pavkout/insomnia that referenced this pull request Jan 18, 2023
* Always generate base environment id when importing

* add unit test

* fix lint

Co-authored-by: Filipe Freire <livrofubia@gmail.com>
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.

Hidden and uneditable environments on Manage Environments after importing JSON
3 participants