Saved filter with assignees doesn't work since 0.22.1 #187

Closed
opened 2025-11-01 20:50:06 -05:00 by GiteaMirror · 13 comments
Owner

Originally created by @mvalois on GitHub (Jan 29, 2024).

Description

I had a saved filter that shows me every tasks where I am assigned on. For that I just created a saved filter with assignees "myusername". It worked well on 0.22.0 until I upgraded to 0.22.1.

Since then the API call to the endpoint '/projects/-5/tasks' returns an empty list (and therefore the board is empty too).
If I filter by another field like label, it works as expected. I tried filtering with other usernames and still didn't get any result.

I observe the same behaviour using Firefox or the desktop app.

Vikunja Frontend Version

0.22.1

Vikunja API Version

0.22.1

Browser and version

Firefox

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

Screenshot 2024-01-29 at 09-56-27 Current Tasks Vikunja
Screenshot 2024-01-29 at 09-56-38 Mes projets Vikunja

Originally created by @mvalois on GitHub (Jan 29, 2024). ### Description I had a saved filter that shows me every tasks where I am assigned on. For that I just created a saved filter with assignees "myusername". It worked well on 0.22.0 until I upgraded to 0.22.1. Since then the API call to the endpoint '/projects/-5/tasks' returns an empty list (and therefore the board is empty too). If I filter by another field like label, it works as expected. I tried filtering with other usernames and still didn't get any result. I observe the same behaviour using Firefox or the desktop app. ### Vikunja Frontend Version 0.22.1 ### Vikunja API Version 0.22.1 ### Browser and version Firefox ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots ![Screenshot 2024-01-29 at 09-56-27 Current Tasks Vikunja](https://github.com/go-vikunja/api/assets/30313678/814c4985-b9d1-4173-bcd7-06d5739adb20) ![Screenshot 2024-01-29 at 09-56-38 Mes projets Vikunja](https://github.com/go-vikunja/api/assets/30313678/e8081107-5fbd-4faa-86c6-f221b6237e77)
GiteaMirror added the bug label 2025-11-01 20:50:06 -05:00
Author
Owner

@kolaente commented on GitHub (Jan 29, 2024):

I'm unable to reproduce this with the latest unstable build.

Does your filter only contain the assignee? Or other attributes as well? Does it work if you recreate the same filter?

@kolaente commented on GitHub (Jan 29, 2024): I'm unable to reproduce this with the latest unstable build. Does your filter only contain the assignee? Or other attributes as well? Does it work if you recreate the same filter?
Author
Owner

@mvalois commented on GitHub (Jan 30, 2024):

The filter only contains the assignee. It does not work if I recreate the same filter.
BTW we have migrated users from local auth to OpenID auth so we may have messed up with something. We only changed issuer from local to our SSO URL. But we done this before migrating to 0.22.1 where it worked well and it also returns empty list with assignees that have a local account.

@mvalois commented on GitHub (Jan 30, 2024): The filter only contains the assignee. It does not work if I recreate the same filter. BTW we have migrated users from local auth to OpenID auth so we may have messed up with something. We only changed `issuer` from `local` to our SSO URL. But we done this before migrating to 0.22.1 where it worked well and it also returns empty list with assignees that have a local account.
Author
Owner

@kolaente commented on GitHub (Jan 30, 2024):

Can you check the actual filter json? Does it contain the correct username? Does it work if you filter on a project (not with a saved filter)

@kolaente commented on GitHub (Jan 30, 2024): Can you check the actual filter json? Does it contain the correct username? Does it work if you filter on a project (not with a saved filter)
Author
Owner

@mvalois commented on GitHub (Jan 30, 2024):

the actual filter json is :

{
  "sort_by": [
    "done",
    "id"
  ],
  "order_by": [
    "asc",
    "desc"
  ],
  "filter_by": [
    "done",
    "assignees"
  ],
  "filter_value": [
    "false",
    "mvalois"
  ],
  "filter_comparator": [
    "equals",
    "in"
  ],
  "filter_concat": "and",
  "filter_include_nulls": true
}

When I filter my username on a project, it also returns an empty list (reproducible with other usernames).

@mvalois commented on GitHub (Jan 30, 2024): the actual filter json is : ```json { "sort_by": [ "done", "id" ], "order_by": [ "asc", "desc" ], "filter_by": [ "done", "assignees" ], "filter_value": [ "false", "mvalois" ], "filter_comparator": [ "equals", "in" ], "filter_concat": "and", "filter_include_nulls": true } ``` When I filter my username on a project, it also returns an empty list (reproducible with other usernames).
Author
Owner

@kolaente commented on GitHub (Jan 30, 2024):

And your username is mvalois on the Vikunja instance? And it is empty with all usernames?

@kolaente commented on GitHub (Jan 30, 2024): And your username is `mvalois` on the Vikunja instance? And it is empty with all usernames?
Author
Owner

@mvalois commented on GitHub (Jan 30, 2024):

Yes my username is mvalois :

MariaDB [vikunja]> select username from users where username='mvalois';
+----------+
| username |
+----------+
| mvalois  |
+----------+

Yes it is empty with every username.

@mvalois commented on GitHub (Jan 30, 2024): Yes my username is `mvalois` : ``` MariaDB [vikunja]> select username from users where username='mvalois'; +----------+ | username | +----------+ | mvalois | +----------+ ``` Yes it is empty with every username.
Author
Owner

@kolaente commented on GitHub (Jan 31, 2024):

It's not really reproducible for me. Can you enable database logging and share the queries being done when you access the filter?

@kolaente commented on GitHub (Jan 31, 2024): It's not really reproducible for me. Can you [enable database logging](https://vikunja.io/docs/config-options/#database-2) and share the queries being done when you access the filter?
Author
Owner

@mvalois commented on GitHub (Feb 1, 2024):

here are the queries :

2024-02-01T10:00:11.151768198+01:00: INFO	▶ [DATABASE] 190 [SQL] SELECT `id`, `filters`, `title`, `description`, `owner_id`, `is_favorite`, `created`, `updated` FROM `saved_filters` WHERE (id = ?) LIMIT 1 [4] - 1.87925ms
2024-02-01T10:00:11.152788164+01:00: INFO	▶ [DATABASE] 191 [SQL] SELECT `id`, `name`, `username`, `password`, `email`, `status`, `avatar_provider`, `avatar_file_id`, `issuer`, `subject`, `email_reminders_enabled`, `discoverable_by_name`, `discoverable_by_email`, `overdue_tasks_reminders_enabled`, `overdue_tasks_reminders_time`, `default_project_id`, `week_start`, `language`, `timezone`, `deletion_scheduled_at`, `deletion_last_reminder_sent`, `frontend_settings`, `export_file_id`, `created`, `updated` FROM `users` WHERE `id`=? LIMIT 1 [4] - 736.875µs
2024-02-01T10:00:11.154070475+01:00: INFO	▶ [DATABASE] 192 [SQL] SELECT `id`, `filters`, `title`, `description`, `owner_id`, `is_favorite`, `created`, `updated` FROM `saved_filters` WHERE (id = ?) LIMIT 1 [4] - 1.485371ms
2024-02-01T10:00:11.154628953+01:00: INFO	▶ [DATABASE] 193 [SQL] SELECT `id`, `filters`, `title`, `description`, `owner_id`, `is_favorite`, `created`, `updated` FROM `saved_filters` WHERE (id = ?) LIMIT 1 [4] - 410.7µs
2024-02-01T10:00:11.155260669+01:00: INFO	▶ [DATABASE] 194 [SQL] SELECT `id`, `name`, `username`, `password`, `email`, `status`, `avatar_provider`, `avatar_file_id`, `issuer`, `subject`, `email_reminders_enabled`, `discoverable_by_name`, `discoverable_by_email`, `overdue_tasks_reminders_enabled`, `overdue_tasks_reminders_time`, `default_project_id`, `week_start`, `language`, `timezone`, `deletion_scheduled_at`, `deletion_last_reminder_sent`, `frontend_settings`, `export_file_id`, `created`, `updated` FROM `users` WHERE `id`=? LIMIT 1 [4] - 455.112µs
2024-02-01T10:00:11.155644473+01:00: INFO	▶ [DATABASE] 195 [SQL] SELECT l.* FROM projects l LEFT JOIN team_projects tl ON tl.project_id = l.id LEFT JOIN team_members tm2 ON tm2.team_id = tl.team_id LEFT JOIN users_projects ul ON ul.project_id = l.id WHERE (tm2.user_id=? OR ul.user_id=? OR l.owner_id=?) AND l.title LIKE ? AND l.is_archived=? AND (l.parent_project_id IS NULL OR l.parent_project_id=? OR ((tm2.user_id IS NOT NULL OR ul.user_id IS NOT NULL) AND l.parent_project_id IS NOT NULL)) AND 0=0 GROUP BY l.id ORDER BY position [4 4 4 %% false 0] - 2.640235ms
2024-02-01T10:00:11.155949458+01:00: INFO	▶ [DATABASE] 196 [SQL] SELECT `entity_id`, `user_id`, `kind` FROM `favorites` WHERE (entity_id = ? AND user_id = ? AND kind = ?) LIMIT 1 [-5 4 2] - 521.015µs
2024-02-01T10:00:11.156857961+01:00: INFO	▶ [DATABASE] 197 [SQL] SELECT `id`, `entity_type`, `entity_id`, `user_id`, `created` FROM `subscriptions` WHERE (user_id = ?) AND entity_id IN (?) AND entity_type=? [4 -5 2] - 543.782µs
2024-02-01T10:00:11.157823448+01:00: INFO	▶ [DATABASE] 198 [SQL] SELECT count(*) FROM projects l LEFT JOIN team_projects tl ON tl.project_id = l.id LEFT JOIN team_members tm2 ON tm2.team_id = tl.team_id LEFT JOIN users_projects ul ON ul.project_id = l.id WHERE (tm2.user_id=? OR ul.user_id=? OR l.owner_id=?) AND l.title LIKE ? AND l.is_archived=? AND (l.parent_project_id IS NULL OR l.parent_project_id=? OR ((tm2.user_id IS NOT NULL OR ul.user_id IS NOT NULL) AND l.parent_project_id IS NOT NULL)) AND 0=0 GROUP BY l.id ORDER BY position [4 4 4 %% false 0] - 1.745573ms
2024-02-01T10:00:11.159167803+01:00: INFO	▶ [DATABASE] 199 [SQL] SELECT l.* FROM projects l LEFT JOIN team_projects tl ON tl.project_id = l.parent_project_id LEFT JOIN team_members tm2 ON tm2.team_id = tl.team_id LEFT JOIN users_projects ul ON ul.project_id = l.parent_project_id WHERE (tm2.user_id=? OR ul.user_id=? OR l.owner_id=?) AND l.title LIKE ? AND l.is_archived=? AND l.parent_project_id IN (?,?,?,?,?,?,?,?,?,?,?,?) AND l.id NOT IN (?,?,?,?,?,?,?,?,?,?,?,?) GROUP BY l.id ORDER BY position [4 4 4 %% false 11 13 17 31 29 12 27 51 52 54 61 22 11 13 17 31 29 12 27 51 52 54 61 22] - 1.197638ms
2024-02-01T10:00:11.159918791+01:00: INFO	▶ [DATABASE] 19a [SQL] SELECT count(*) FROM `favorites` WHERE user_id=? AND kind=? [4 1] - 420.324µs
2024-02-01T10:00:11.162018081+01:00: INFO	▶ [DATABASE] 19c [SQL] SELECT `id`, `title`, `description`, `done`, `done_at`, `due_date`, `project_id`, `repeat_after`, `repeat_mode`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `index`, `uid`, `cover_image_attachment_id`, `created`, `updated`, `bucket_id`, `position`, `kanban_position`, `created_by_id` FROM `tasks` WHERE 0=1 ORDER BY `position` IS NULL, `position` asc, `position` IS NULL, `position` asc, `created` IS NULL, `created` desc [] - 267.237µs

I also noticed there is an error in the stderr when accessing the filter:

2024-02-01T10:00:11.160116957+01:00: ERROR	▶ models/convertFilterValues 19b Unknown search type for value [mvalois]
@mvalois commented on GitHub (Feb 1, 2024): here are the queries : ``` 2024-02-01T10:00:11.151768198+01:00: INFO ▶ [DATABASE] 190 [SQL] SELECT `id`, `filters`, `title`, `description`, `owner_id`, `is_favorite`, `created`, `updated` FROM `saved_filters` WHERE (id = ?) LIMIT 1 [4] - 1.87925ms 2024-02-01T10:00:11.152788164+01:00: INFO ▶ [DATABASE] 191 [SQL] SELECT `id`, `name`, `username`, `password`, `email`, `status`, `avatar_provider`, `avatar_file_id`, `issuer`, `subject`, `email_reminders_enabled`, `discoverable_by_name`, `discoverable_by_email`, `overdue_tasks_reminders_enabled`, `overdue_tasks_reminders_time`, `default_project_id`, `week_start`, `language`, `timezone`, `deletion_scheduled_at`, `deletion_last_reminder_sent`, `frontend_settings`, `export_file_id`, `created`, `updated` FROM `users` WHERE `id`=? LIMIT 1 [4] - 736.875µs 2024-02-01T10:00:11.154070475+01:00: INFO ▶ [DATABASE] 192 [SQL] SELECT `id`, `filters`, `title`, `description`, `owner_id`, `is_favorite`, `created`, `updated` FROM `saved_filters` WHERE (id = ?) LIMIT 1 [4] - 1.485371ms 2024-02-01T10:00:11.154628953+01:00: INFO ▶ [DATABASE] 193 [SQL] SELECT `id`, `filters`, `title`, `description`, `owner_id`, `is_favorite`, `created`, `updated` FROM `saved_filters` WHERE (id = ?) LIMIT 1 [4] - 410.7µs 2024-02-01T10:00:11.155260669+01:00: INFO ▶ [DATABASE] 194 [SQL] SELECT `id`, `name`, `username`, `password`, `email`, `status`, `avatar_provider`, `avatar_file_id`, `issuer`, `subject`, `email_reminders_enabled`, `discoverable_by_name`, `discoverable_by_email`, `overdue_tasks_reminders_enabled`, `overdue_tasks_reminders_time`, `default_project_id`, `week_start`, `language`, `timezone`, `deletion_scheduled_at`, `deletion_last_reminder_sent`, `frontend_settings`, `export_file_id`, `created`, `updated` FROM `users` WHERE `id`=? LIMIT 1 [4] - 455.112µs 2024-02-01T10:00:11.155644473+01:00: INFO ▶ [DATABASE] 195 [SQL] SELECT l.* FROM projects l LEFT JOIN team_projects tl ON tl.project_id = l.id LEFT JOIN team_members tm2 ON tm2.team_id = tl.team_id LEFT JOIN users_projects ul ON ul.project_id = l.id WHERE (tm2.user_id=? OR ul.user_id=? OR l.owner_id=?) AND l.title LIKE ? AND l.is_archived=? AND (l.parent_project_id IS NULL OR l.parent_project_id=? OR ((tm2.user_id IS NOT NULL OR ul.user_id IS NOT NULL) AND l.parent_project_id IS NOT NULL)) AND 0=0 GROUP BY l.id ORDER BY position [4 4 4 %% false 0] - 2.640235ms 2024-02-01T10:00:11.155949458+01:00: INFO ▶ [DATABASE] 196 [SQL] SELECT `entity_id`, `user_id`, `kind` FROM `favorites` WHERE (entity_id = ? AND user_id = ? AND kind = ?) LIMIT 1 [-5 4 2] - 521.015µs 2024-02-01T10:00:11.156857961+01:00: INFO ▶ [DATABASE] 197 [SQL] SELECT `id`, `entity_type`, `entity_id`, `user_id`, `created` FROM `subscriptions` WHERE (user_id = ?) AND entity_id IN (?) AND entity_type=? [4 -5 2] - 543.782µs 2024-02-01T10:00:11.157823448+01:00: INFO ▶ [DATABASE] 198 [SQL] SELECT count(*) FROM projects l LEFT JOIN team_projects tl ON tl.project_id = l.id LEFT JOIN team_members tm2 ON tm2.team_id = tl.team_id LEFT JOIN users_projects ul ON ul.project_id = l.id WHERE (tm2.user_id=? OR ul.user_id=? OR l.owner_id=?) AND l.title LIKE ? AND l.is_archived=? AND (l.parent_project_id IS NULL OR l.parent_project_id=? OR ((tm2.user_id IS NOT NULL OR ul.user_id IS NOT NULL) AND l.parent_project_id IS NOT NULL)) AND 0=0 GROUP BY l.id ORDER BY position [4 4 4 %% false 0] - 1.745573ms 2024-02-01T10:00:11.159167803+01:00: INFO ▶ [DATABASE] 199 [SQL] SELECT l.* FROM projects l LEFT JOIN team_projects tl ON tl.project_id = l.parent_project_id LEFT JOIN team_members tm2 ON tm2.team_id = tl.team_id LEFT JOIN users_projects ul ON ul.project_id = l.parent_project_id WHERE (tm2.user_id=? OR ul.user_id=? OR l.owner_id=?) AND l.title LIKE ? AND l.is_archived=? AND l.parent_project_id IN (?,?,?,?,?,?,?,?,?,?,?,?) AND l.id NOT IN (?,?,?,?,?,?,?,?,?,?,?,?) GROUP BY l.id ORDER BY position [4 4 4 %% false 11 13 17 31 29 12 27 51 52 54 61 22 11 13 17 31 29 12 27 51 52 54 61 22] - 1.197638ms 2024-02-01T10:00:11.159918791+01:00: INFO ▶ [DATABASE] 19a [SQL] SELECT count(*) FROM `favorites` WHERE user_id=? AND kind=? [4 1] - 420.324µs 2024-02-01T10:00:11.162018081+01:00: INFO ▶ [DATABASE] 19c [SQL] SELECT `id`, `title`, `description`, `done`, `done_at`, `due_date`, `project_id`, `repeat_after`, `repeat_mode`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `index`, `uid`, `cover_image_attachment_id`, `created`, `updated`, `bucket_id`, `position`, `kanban_position`, `created_by_id` FROM `tasks` WHERE 0=1 ORDER BY `position` IS NULL, `position` asc, `position` IS NULL, `position` asc, `created` IS NULL, `created` desc [] - 267.237µs ``` I also noticed there is an error in the stderr when accessing the filter: ``` 2024-02-01T10:00:11.160116957+01:00: ERROR ▶ models/convertFilterValues 19b Unknown search type for value [mvalois] ```
Author
Owner

@kolaente commented on GitHub (Feb 1, 2024):

I also noticed there is an error in the stderr when accessing the filter:

That probably is the cause.
I've just pushed a change (8efdc96d02) which adds more logging to that case. Please pull the next unstable build (ready in ~45min) and check the log message again.

@kolaente commented on GitHub (Feb 1, 2024): > I also noticed there is an error in the stderr when accessing the filter: That probably is the cause. I've just pushed a change (8efdc96d02b89a5f2fabb666ab62a9202a00cbfc) which adds more logging to that case. Please pull the next unstable build (ready in ~45min) and check the log message again.
Author
Owner

@mvalois commented on GitHub (Feb 1, 2024):

here is the log

2024-02-01T21:54:31.020532921+01:00: ERROR      ▶ models/convertFilterValues 133 Unknown search type for value [mvalois] of type []string
@mvalois commented on GitHub (Feb 1, 2024): here is the log ``` 2024-02-01T21:54:31.020532921+01:00: ERROR ▶ models/convertFilterValues 133 Unknown search type for value [mvalois] of type []string ```
Author
Owner

@mvalois commented on GitHub (Feb 2, 2024):

Weird, I reimported the database (mysql) in my other test instance and the filter is working as expected.

I tried to reimport it in another database on the same mysql server but the filters do not work. So it looks it is due to the server itself. However they look to be utf8 compatible:

> SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = 'vikunja';
+----------------------------+
| default_character_set_name |
+----------------------------+
| utf8mb4                    |
+----------------------------+
@mvalois commented on GitHub (Feb 2, 2024): Weird, I reimported the database (mysql) in my other test instance and the filter is working as expected. I tried to reimport it in another database on the same mysql server but the filters do not work. So it looks it is due to the server itself. However they look to be utf8 compatible: ``` > SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = 'vikunja'; +----------------------------+ | default_character_set_name | +----------------------------+ | utf8mb4 | +----------------------------+ ```
Author
Owner

@kolaente commented on GitHub (Feb 5, 2024):

Should be fixed in b95b92a23a. Please check with the next unstable build (ready in ~45min) if the problem went away.

@kolaente commented on GitHub (Feb 5, 2024): Should be fixed in https://github.com/go-vikunja/api/commit/b95b92a23add9942c5c0425322f692b4304831ff. Please check with the next unstable build (ready in ~45min) if the problem went away.
Author
Owner

@mvalois commented on GitHub (Feb 6, 2024):

Yes, the problem went away with your fix. Thank you =)

@mvalois commented on GitHub (Feb 6, 2024): Yes, the problem went away with your fix. Thank you =)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#187