Skip to content

Commit c527bba

Browse files
committed
Fix issue with recurring tasks search
1 parent f5b40b7 commit c527bba

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

backend/routes/tasks.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,13 @@ async function undoneAllSubtasks(parentTaskId, userId) {
454454

455455
// Filter tasks by parameters
456456
async function filterTasksByParams(params, userId, userTimezone) {
457+
// Disable search functionality for upcoming view
458+
if (params.type === 'upcoming') {
459+
// Remove search-related parameters to prevent search functionality
460+
params = { ...params, client_side_filtering: false };
461+
delete params.search;
462+
}
463+
457464
let whereClause = {
458465
user_id: userId,
459466
parent_task_id: null, // Exclude subtasks from main task lists
@@ -558,6 +565,7 @@ async function filterTasksByParams(params, userId, userTimezone) {
558565

559566
// For upcoming view, we want to show recurring instances (children) with due dates
560567
// Override the default whereClause to include recurring instances
568+
// NOTE: Search functionality is disabled for upcoming view - ignore client_side_filtering
561569
whereClause = {
562570
user_id: userId,
563571
parent_task_id: null, // Exclude subtasks from main task lists
@@ -608,8 +616,8 @@ async function filterTasksByParams(params, userId, userTimezone) {
608616
whereClause.status = Task.STATUS.WAITING;
609617
break;
610618
case 'all':
611-
// Exclude recurring task instances from all view
612-
whereClause.recurring_parent_id = null;
619+
// For 'all' view, include both recurring templates and instances
620+
// The complex OR logic above already handles this correctly
613621
if (params.status === 'done') {
614622
whereClause.status = { [Op.in]: [Task.STATUS.DONE, 'done'] };
615623
} else if (!params.client_side_filtering) {

frontend/components/Tasks.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ const Tasks: React.FC = () => {
9494
filteredTasks = filteredTasks.filter(
9595
(task) =>
9696
task.name.toLowerCase().includes(query) ||
97+
task.original_name?.toLowerCase().includes(query) ||
9798
task.note?.toLowerCase().includes(query)
9899
);
99100
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tududi",
3-
"version": "v0.82-rc4",
3+
"version": "v0.82-rc5",
44
"description": "Self-hosted task management with hierarchical organization, multi-language support, and Telegram integration.",
55
"directories": {
66
"test": "test"

0 commit comments

Comments
 (0)