Wappler Version : 7.3.1
Operating System : MacOS
Server Model: NodeJS
Database Type: MySQL
Hosting Type: Docker
Expected behavior
What do you think should happen?
When Project Options are saved, no changes are expected in the files listed below unless specific files linked to setup fields are required to be modified.
In this instance, the files were modified when I created a new app connect extension under Project Options.
Actual behavior
What actually happens?
When Project Options are saved, it modifies the following files for all Project targets
targetname/app/config/config.json - just adds an additional row at the end
targetname/app/modules/connections/db.json - resets the Port No. from 9910 to 3306 if custom cloud databases are being used; removes charset utf8mb4; rearranges code lines
targetname/web/Dockerfile - removes any custom information. example changes FROM node:22-alpine3.19 to FROM node:22; deletes any non-standard ENV or additional runtime packages
app/modules/connections/db.json - removes charset utf8mb4; resets the Port No to 3306 if a cloud database is in use
How to reproduce
Open Project Options, modify a field and Save. The files listed above will appear in the list of changed files (GIT).
Note: This happens even when project options are saved without modifying any fields. When this happens, I have to check every file to ensure that project setup is still valid especially Port No. and Dockerfile contents.
I also confirm this, I have environment variables expressions in the database settings JSON, and it keeps resetting to regular credentials/port numbers. To be honest not sure the best way to solve this
Bind-mount folders I added in docker-compose are also removed
You are entering target options, choosing the specific deployment options and those are saved to the right files.
We can’t just save them once and let you edit the source in the files directly afterwards.
If some options are missing or wrongly saved then you can report that, but otherwise the whole point of having target options to the use them and generate the needed configs on save each time.
I'm not editing the source files directly. These files are being changed when Project Options are saved, regardless of whether any settings are modified or not.
I understand the logic behind maintaining the config files and Dockerfile at least with the basic required information. However, changing / resetting the db.json files to standard Port No etc. (depending on the database in use) breaks the app.
I have included below a scressnhot of the changes in db.json when I saved Project Options without modifying any setup information. I used ENV vars to define Port No and charset (I thought that it might persist during the save process of Project Options). After saving Project Options, I can see 12 changed files in the GIT, and none were expected to be modified.
First do note that project options are leading, so you should keep the database options there.
So if you want to use different database port per target or read it from environment variable just enter the expression there.
Second the charset and tz options are no longer needed and deprecated by the database options.
Those are now controlled by the timezone setting that we have. So old charset and tz settings are removed already sometime ago from the database options.