tracardi icon indicating copy to clipboard operation
tracardi copied to clipboard

Event should be saved even if it does not pass validation

Open atompie opened this issue 3 years ago • 0 comments

Describe the bug

Now the error is returned when the event does not pass event validation. It is OK by the event should be saved with the status not validated. There should be no way to loose send event data event the event is not correct.

To Reproduce

Steps to reproduce the behavior:

  1. Create strict JSONSchema validator like:
{
  "event@properties": {
    "type": "object",
    "required": [
      "firstName"
    ],
    "properties": {
      "firstName": {
        "type": "string",
        "description": "The person's first name."
      },
      "lastName": {
        "type": "string",
        "description": "The person's last name."
      },
      "age": {
        "description": "Age in years which must be equal to or greater than zero.",
        "type": "integer",
        "minimum": 0
      }
    }
  }
}
  1. Test it without required firstName
  2. It should return error
  3. And the event should not be saved.

Expected behavior

Event with status invalid. Also the session should be saved but no profile created. No rules and workflows should be executed.

atompie avatar Sep 11 '22 20:09 atompie