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

[OGUI-1455] Logging live mode filters/criteria #2684

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

Houwie7000
Copy link
Collaborator

I have JIRA issue created

  • branch and/or PR name(s) includes JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected
  • FLP integration tests were ran successful

* @param {object} criteria - criteria to be minified
* @returns {object} minimal filter object
*/
minifyCriteria(criteria) {
Copy link
Member

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));
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants