This is the first time I have come across this issue with Environment Variables (config.json) and DB Connection details (db.json).
When I update values for a target in the Environment variables and DB Connection details under Global > DB Connetions, the values are correctly saved for that target.
But, these changes seem to overwrite the values in config.json and/or db.json for other targets. I’m updating the values for the environment variables and database connections by selecting each target, but when I switch to another target, the last saved values show up for the now selected target.
I just can't figure out what's causing this issue. Any help would be greatly appreciated.
I’ve noticed this problem cropping up in other projects too. The targets display the right values for the first time. However, when I switch back to other targets, the values from the previously selected ones reappear.
Could you point me to where I might find this issue? Is it just happening in my setup, or is it a bug in the v7.7.6 core application (I updated to v7.7.6 today and these issues have begin to appear since that update)? This has a potential to corrupt the web deployments if I'm not careful with the config and db json values.
I think the whole database connection side needs a review as currently you can set a database in the Project target settings, in the database connection area (side panel), and again in globals. I'm not sure which acts as the parent? Which leads to situations like the above. Also I can set environmental variables in the globals area (by pasting them in, so would be nice if they could be selected using the lightening bolt data picker) but I can't do this in the database connection settings in the side panel (connection fails if you paste in environmental variables) or in the Target connections...? Surely there must be a unified solution?
This is the first time I have seen values for config.json and db.json being retained when switching between targets, as if values from the last target are being stored in the memory and then applied to the selected target.
I agree that a unified approach would be great. Having the database connections defined in one central spot and then assigning them to each target would make things much easier to understand and manage.
Also, there are three areas where things could go wrong if the information is not correct.
I have highlighted in some of my previous posts that saving target information can modify the existing database connection and docker yml details and stop the web apps from running altogether.
I am experiencing the same issue. In my ENV settings for local dev I had some different settings to that of my live remote server. I switch to my live server then returned back to ny local dev and the env variables were overridden by my live variables. Not good
I have extracted and replaced the file as per your post. I can confirm that the target and ENV variable values are being updated correctly when switching between targets.