Ambiguous routes: ProjectEdit and FilterEdit #2202

Open
opened 2026-03-22 13:57:18 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @vikunja-bot on GitHub (Apr 1, 2025).

Original issue by dpschen on 2025-01-19T14:04:27.000Z

Description

The routes to edit projects and filters are not ambiguous.
Consecutive loading the edit modal of a filter via it's url opens a buggy edit modal of a (non-existing) project instead.

While working on https://kolaente.dev/vikunja/vikunja/pulls/2950 this caught my attention, because the folderpaths are basically identical.

This probably wasn't caught because navigation via the RouteName works as intended ('project.settings.edit' and 'filter.settings.edit'), so only a reload triggers the error.

Reason seems to be that both routes target the same address:

ProjectSettingEdit:

		{
			path: '/projects/:projectId/settings/edit',
			name: 'project.settings.edit',
			component: ProjectSettingEdit,
			props: route => ({ projectId: Number(route.params.projectId as string) }),
			meta: {
				showAsModal: true,
			},
		},

FilterEdit:

		{
			path: '/projects/:projectId/settings/edit',
			name: 'filter.settings.edit',
			component: FilterEdit,
			meta: {
				showAsModal: true,
			},
			props: route => ({ projectId: Number(route.params.projectId as string) }),
		},

Step by step reproduction:

  1. Navigate to /projects and click on New Saved Filter.
  2. Type Example and click Create Saved Filter.
  3. The newly created filter opens
  4. Click in the header bar on the three dots next to the filter name and select Edit in the menu that opens. The FilterSettingsEdit modal opens (title: 'Edit This Saved Filter').
  5. Hard reload the browser.
  6. The ProjectSettingsEdit modal opens (title: 'Edit This Project').

Since https://kolaente.dev/vikunja/vikunja/pulls/2950 changes a lot of the routing I would wait for that branch to be merged.

In general we would need to check if the id number starts with a minus and behave accordingly.
We should probably also check if there are other routes that should be adjusted.
E.g. we could adapt the 'duplicate project' modal accordingly respectively add a 'duplicate saved project'.

Vikunja Version

v0.24.1-696-ea6b141d42

Browser and version

all

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

Screenshot 2025-01-19 at 14.56.26.pngScreenshot 2025-01-19 at 14.56.38.png

Original issue on Gitea


@kolaente commented on 2025-01-19T19:48:29.000Z:

In general we would need to check if the id number starts with a minus and behave accordingly.

So this would be the solution here? And then unify both components?


dpschen commented on 2025-01-19T19:52:46.000Z:

This could be a solution. But to be honest I think it would be better to separate projects from filters in the routes. Or is there some specific reason why they need to me together? Creating new filters also happens on a route that has 'filter' in it.

Originally created by @vikunja-bot on GitHub (Apr 1, 2025). _Original issue by dpschen on 2025-01-19T14:04:27.000Z_ ### Description The routes to edit projects and filters are not ambiguous. Consecutive loading the edit modal of a filter via it's url opens a buggy edit modal of a (non-existing) project instead. While working on https://kolaente.dev/vikunja/vikunja/pulls/2950 this caught my attention, because the folderpaths are basically identical. This probably wasn't caught because navigation via the RouteName works as intended (`'project.settings.edit'` and `'filter.settings.edit'`), so only a reload triggers the error. Reason seems to be that both routes target the same address: **ProjectSettingEdit:** ```json { path: '/projects/:projectId/settings/edit', name: 'project.settings.edit', component: ProjectSettingEdit, props: route => ({ projectId: Number(route.params.projectId as string) }), meta: { showAsModal: true, }, }, ``` **FilterEdit:** ```json { path: '/projects/:projectId/settings/edit', name: 'filter.settings.edit', component: FilterEdit, meta: { showAsModal: true, }, props: route => ({ projectId: Number(route.params.projectId as string) }), }, ``` Step by step reproduction: 1) Navigate to `/projects` and click on `New Saved Filter`. 2) Type `Example` and click `Create Saved Filter`. 3) The newly created filter opens 4) Click in the header bar on the three dots next to the filter name and select `Edit` in the menu that opens. The `FilterSettingsEdit` modal opens (title: 'Edit This Saved Filter'). 5) Hard reload the browser. 6) The `ProjectSettingsEdit` modal opens (title: 'Edit This Project'). ------- Since https://kolaente.dev/vikunja/vikunja/pulls/2950 changes a lot of the routing I would wait for that branch to be merged. In general we would need to check if the id number starts with a minus and behave accordingly. We should probably also check if there are other routes that should be adjusted. E.g. we could adapt the 'duplicate project' modal accordingly respectively add a 'duplicate saved project'. ### Vikunja Version v0.24.1-696-ea6b141d42 ### Browser and version all ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots <img width="908" alt="Screenshot 2025-01-19 at 14.56.26.png" src="attachments/603e1e94-d518-47d3-977a-b8ed29426041"><img width="927" alt="Screenshot 2025-01-19 at 14.56.38.png" src="attachments/b93a65fb-ab27-4e89-9232-8730d26a3599"> [Original issue on Gitea](https://kolaente.dev/vikunja/vikunja/issues/3029) --- _**@kolaente** commented on 2025-01-19T19:48:29.000Z_: > In general we would need to check if the id number starts with a minus and behave accordingly. So this would be the solution here? And then unify both components? --- _**dpschen** commented on 2025-01-19T19:52:46.000Z_: This could be **a** solution. But to be honest I think it would be better to separate projects from filters in the routes. Or is there some specific reason why they need to me together? Creating new filters also happens on a route that has 'filter' in it.
Author
Owner

@kolaente commented on GitHub (Aug 3, 2025):

@dpschen how can we move forward here?

@kolaente commented on GitHub (Aug 3, 2025): @dpschen how can we move forward here?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#2202