-
Notifications
You must be signed in to change notification settings - Fork 13
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
[OGUI-1455] Logging live mode filters/criteria #2684
base: dev
Are you sure you want to change the base?
Conversation
* @param {object} criteria - criteria to be minified | ||
* @returns {object} minimal filter object | ||
*/ | ||
minifyCriteria(criteria) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Houwie7000 as this is a utility function, I think it is better if we move it to an independent JS module in an utility folder.
As currently there is no such folder, please create one and add this function to its own module. Then call it from there in the WS server.
The tests associated to this function should match the folder structure as well
*/ | ||
minifyCriteria(criteria) { | ||
// Copy everything | ||
const criterias = JSON.parse(JSON.stringify(criteria)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this function minifyCriteria
is called form the WS server directly and there is no try-catch
associated to it which means if the criteria is in a bad format it will crash the server.
I would recommend you add this function in a try catch and log in case of error that the payload criteria is not a correct format. We should not log the payload (as it is user input) as it might contain an injection attack
I have JIRA issue created