-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Environment variables at folder level not saving state #5612
Comments
Update: Reverting to 2022.6.0 resolves this issue. |
Not a workaround, but after creating the variable, exiting Insomnia and restarting, the variables would sometimes persist. |
+1 |
I've got this issue too (version 2022.7.5 on Fedora) with a valid tag of type "response body attribute": Although, after having saved the environment, there was no data saved. I've modified manually my environment variable in the
Before I update it, there was only this value recorded:
Note, that the behavior of the environment editor is very wired: it updates the database file with lot of useless information and seems to not take data from the tag form. See below for an example. First I open the environment editor and I add added a property named The editor is still open and it already saved all these data in the
Then I add a valid "response body attribute" tag as value (live preview is working), I get in the file:
As you can see, the tag setup state is not saved. Finally, I click the Close button of the environment editor and I get:
I expected the first file update here with the correct tag setup. Then, if I close Insomnia and start it again, I got:
Finally, it's cleaned correctly after Insomnia reboot ! But I never seen the settings I've set in the tag editor. |
When I edit a tag, go back to the JSON Environment and make any changes (add a new line for example) the changes are saved. Version: Insomnia 2023.1.0 |
Thanks, it works for me too. That's a nicer workaround :) |
I'm seeing this again in the latest version. I can go into environment variables, edit them, save them. Then when I close the env editor and open them again, they have reverted.
|
Same here. Amount of regression bugs in Insomnia is insane recently. Things get broken, fixed, then broken again. |
It does not work for me, even if a blank line between variable, it does not save. |
I have found a resolution for this issue and PR #7330 has been created with my changes. My experience with JS applications is limited so my implementation may require adjustments, but I verified it does persist changes as expected. There are two issues at play here:
insomnia/packages/insomnia/src/ui/components/modals/environment-edit-modal.tsx Lines 48 to 58 in 69fb149
My PR proposes the following solutions:
My solution around collection state management may require changes to conform with idiomatic javascript. This is where my weakness shows and I am hoping someone can help adjust that piece if needed. Additionally, I do wonder if the loading and management of the collection should occur in the RequestGroupActionsDropdown component rather than in the I have also added playwright smoke tests within my PR so that hopefully this issue does not come back up in the future. |
Unfortunately my previous PR failed some of the smoke tests with my changes so I went back and re-reviewed my changes and created PR #7371 as a result. I was able to reduce the footprint of my changes significantly using |
@gatzjames @jackkav @filfreire Let me know if my PR is not satisfactory and changes need to be made that I can take on. Otherwise if this is an undesired change I can reduce the PR even further to only include the OnHide changes so at least the database can correctly update on environment override changes. Happy to make changes either way as long as some improvement can be made on this issue! |
Description:
When updating an environment variable at the folder level, exiting and then going back into environment variables doesn't reflect and reverts to previous assigned value.
Step 1: Create new variable "Test"
Step 2: Edit Variable and set header name to 'A'
Step 3: Exit to folder view
Step 4: Open env variables for the same folder.
Step 5: Open test assignment.
Step 6: Variables have not been updated.
Sometimes we found waiting ~1 minute allows config/env variable to save.
The text was updated successfully, but these errors were encountered: