You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In form logic, specific field types are only compatible with certain specific "condition states", e.g. dropdown fields can only be used with "is equals to" or "is either" conditions.
However, the backend does not enforce this coupling between field types and condition states. It simply accepts any field ID linked to any possible condition state. For example, nothing is stopping the frontend from mistakenly saving a logic unit where an "is greater than" condition is applied to a dropdown field. This introduces risks for the React frontend migration, since sending API calls with the wrong logic unit shape could result in corruption of the database state.
This should be tackled in a few steps:
Check that the current database does not contain any mismatched logic conditions.
Enforce the correct matching of logic conditions to field types in the model layer.
Enforce the correct shape of logic API calls through Joi validation.
The text was updated successfully, but these errors were encountered:
on second thoughts, not clear if Joi validation can be used here, since the Joi validator only has access to the field ID and not the field type, and hence may not be able to check if the corresponding conditions are valid
In form logic, specific field types are only compatible with certain specific "condition states", e.g. dropdown fields can only be used with "is equals to" or "is either" conditions.
However, the backend does not enforce this coupling between field types and condition states. It simply accepts any field ID linked to any possible condition state. For example, nothing is stopping the frontend from mistakenly saving a logic unit where an "is greater than" condition is applied to a dropdown field. This introduces risks for the React frontend migration, since sending API calls with the wrong logic unit shape could result in corruption of the database state.
This should be tackled in a few steps:
The text was updated successfully, but these errors were encountered: