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

Check if config field is used anywhere in the code #249

Open
destag opened this issue Jun 5, 2024 · 1 comment
Open

Check if config field is used anywhere in the code #249

destag opened this issue Jun 5, 2024 · 1 comment
Assignees

Comments

@destag
Copy link
Contributor

destag commented Jun 5, 2024

We use :config field in Org, ActionPage and Campaign schemas. It is data used by widgets, stored in jsonb format. It appears to be unused by the application but can cause some issues like #229

If possible we should change type of these fields from :map to :string

@tttp Please comment if anything is incorrect or require more details

@tttp
Copy link
Member

tttp commented Jun 5, 2024

Just to clarify: it is unused by the server, but it is used by the front end widget builder:

https://github.com/fixthestatusquo/proca

for instance to define if the phone number field is displayed or not, but many many options

however, the general architecture is that the server should work, no matter if the widget collects a phone number or not, and shouldn't care about what's in the config, just store the phone number if it's sent to the api when submitting an action

In general, any setting that has an impact on the server (eg. if the action needs to be confirmed before being processed further or if there is a thank you email to send) is stored in separate attributes (column, status, new record...) instead of being put into a config json blob

we store the data into jsonb but we should only use it for statistics or search (eg find all the widgets that have a donation state) but shouldn't be used to change the behaviour of the server

Does it make sense?

if any value stored in the config is used in the elixir server, I'd consider it as a bug and it should be moved to a specific storage, not into the json

X+

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

When branches are created from issues, their pull requests are automatically linked.

2 participants