Comment on [Bug] Boolean lines in contact allowlists with more than one OR don't work

jupiter_rowland@hub.netzgemeinde.eu@hub.netzgemeinde.eu ⁨1⁩ ⁨week⁩ ago

As of Hubzilla 11.4.1, the behaviour seems to have changed.

If you have a chain of criteria with OR (||) between them on the allowlist, only the first and last criteria will pass.

If you have ?body ~= foo || ?body ~= bar || ?body ~= baz as an allowlist line:

Likewise, if you have ?body ~= foo || ?body ~= bar || ?body ~= baz || ?body ~= qux || ~body ~= quux as an allowlist line:

Test cases:
        'incl: three criteria with OR, all keywords expected in the body, first one present in the body' => [
            '?body ~= grasshopper || ?body ~= rosencrantz || ?body ~= guildenstern',
            '',
            true
        ],
        'incl: three criteria with OR, all keywords expected in the body, second one present in the body' => [
            '?body ~= rosencrantz || ?body ~= grasshopper || ?body ~= guildenstern',
            '',
            true
        ],
        'incl: three criteria with OR, all keywords expected in the body, last one present in the body' => [
            '?body ~= rosencrantz || ?body ~= guildenstern || ?body ~= grasshopper',
            '',
            true
        ],
        'incl: three criteria with OR, all keywords expected in the body, first one present in the body; excl: item must not be a repeat' => [
            '?body ~= grasshopper || ?body ~= rosencrantz || ?body ~= guildenstern',
            '?verb == Announce',
            true
        ],
        'incl: three criteria with OR, all keywords expected in the body, second one present in the body; excl: item must not be a repeat' => [
            '?body ~= rosencrantz || ?body ~= grasshopper || ?body ~= guildenstern',
            '?verb == Announce',
            true
        ],
        'incl: three criteria with OR, all keywords expected in the body, last one present in the body; excl: item must not be a repeat' => [
            '?body ~= rosencrantz || ?body ~= guildenstern || ?body ~= grasshopper',
            '?verb == Announce',
            true
        ],

The second and the fifth test case should fail, the others should pass.

original
Sort:hotnewtop