Even though it’s true that for Typesense search we want the maximum to be 250, I’m now thinking why scheduled cron job “RegisterAddTaskToFilterViewCron” uses Typesense at all knowing it’s hits amount limitation?
DB searcher is what we need here IMHO, otherwise we skip calculation of task positions if amount of tasks in saved filter > 250.
It’s also a CRON job, data retrieval speed is not priority here.
Dev Details
As an example task_position#RecalculateTaskPositions method seems to be aware of this, so I suggest to copy task searching logic from RecalculateTaskPositions into the CRON job:
We’re directly using the db here, even if Typesense is configured, because in some edge cases Typesense does not know about all tasks. These tasks then won’t have their position recalculated, which means they will seemingly jump around after reloading their project. The real fix here is of course to make sure all tasks are indexed in Typesense, but until that’s fixed, this solves the issue of task positions not being saved.
allTasks, _, err := dbSearcher.Search(opts)
This probably deserves a separate bug report.