Fields with NULL break boolean logic

Comparisons with NULL always yield ‘true’.
Lists all tasks without a startDate (startDate=NULL):
done = false && startDate<=now

Also lists all tasks without a startDate:
done = false && startDate>now

Consequently this also lists all tasks without a startDate:
done = false && ((startDate<=now) && (startDate>now))

And the expectation that the result of a comparison must always be boolean seems treacherous…
Because this also lists all tasks without a startDate:
done = false && NOT ((startDate<=now) && (startDate>now))

I guess the comparison with NULL yields in fact NULL and is just interpreted as true in the end (but not within braced expressions)?

If no date is set on a task, the actual value saved is 0001-01-01. That’s because handling this internally makes it easier to save as this value.

Because 0001-01-01 is an actual date, it is handled as such by the filter.

The NOT operator is not supported.

OK. It happily accepts the filter though.

But it is weird how it can be both in the past and in the future.
Tasks with no startDate appear in both filters, with startDate>now and startDate<=now.

I created three tasks in try:

  1. with startDate passed
  2. with startDate in the future
  3. without startDate

and three filters:

  1. startDate passed: startDate<=now
  2. startDate in the future: startDate>now
  3. startDate in the past, present AND future at the same time: startDate<=now && startDate>now
    The third condition should be impossible to match.
    However, the task without a startDate matches all three filters.

I just noticed that the problem only exists with saved filters.
The filter button in the top right corner of a project view actually works.

That does sound like a bug. I’ll take a look.

@kolaente do I understand it correctly that there’s no way to simply filter tasks which e.g. dueDate is null?
When I do following expression:

due_date is null

It results in displaying both tasks with due date and without it - isn’t this simple null check supported?

Given the defaut date value I’ve also tested the following expression:

dueDate < ‘0003-01-03 00:00’

And it works, BUT in try.vikunja.io. not on my local setup.
Could it be because I have Typesense configured?

It may be because try runs an other/newer version than your installation.
I am on version: v0.24.1-606-297817d3f8 now and it works as expected.
Edit: Make sure to check off “Include tasks which don’t have a value set”.

1 Like

No, that’s not supported.

Which Vikunja version are you running?

I’m not the person who originally asked, but it does appear to be Typesense-related. The tasks without due dates are shown with a query for dueDate < '0003-01-03 00:00' when I disable Typesense.

Vikunja api version v0.24.6
Built with go1.23.4

I’m using version 27.1 of Typesense. Both Vikunja and the Typesense instance are running in (rootless) Docker containers.

@ethan thank you for confirming the bug! Indeed, seems Typesense related.