Skip to content

[Bug] Automation filter 'not_equal' doesn't give the expected result when testing empty_value. #1932

@DelBiss

Description

@DelBiss

Current Behavior

When a filter setup on a field with matching condition not equals and value <empty/no value>, when the datasource doesn't exist, the filter return true

Expected Behavior

When a filter setup on a field with matching condition not equals and value <empty/no value>, when the datasource doesn't exist, the filter should return false

Step to reproduce

  1. Setup a OSC Server to receive message (ex: Protokol).

  2. Prepare a Rundown with a string customfield (ex: test).

  3. Create 2 events:

    • In event 1, fill the customfield with the value "MyField".
    • In event 2, make sure the customfield is empty
  4. Ensure that Enable automations is set to true in the Automation settings

  5. Create an automation:

    • Where all filters need to pass.
    • With a filter on the create customfield where is not equals to an <empty/no value>
    • With an output of type OSC:
      • Make sure fields Target IP and Target Port point to the OSC Server setup at point 1.
      • Put a valid value in fields Address
      • Put the customfield in the field Arguments (ex: {{eventNow.custom.test}})
  6. Play event 1 and notice on your OSC Server that:

    • The automation have triggered
    • The argument value is "MyField"
  7. Play event 2 and notice on you OSC Server that:

    • The automation have triggered
    • The argument value is "{{eventNow.custom.test}}"

Unit test Suggestion

// apps\server\src\api-data\automation\__tests__\automation.service.test.ts
    it('should check if a value does exist', () => {
      const mockStore = makeRuntimeStateData({ eventNow: null });
      expect(
        testConditions([{ field: 'eventNow.title', operator: 'not_equals', value: '' }], 'all', mockStore),
      ).toBe(false);
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions