While building the journeydoc capture spec (#437) I discovered the Procest SPA shell does not resolve when the URL has a trailing slash.
Repro
- Open
http://localhost:8080/apps/procest/ (with trailing slash) — Nextcloud renders "Page not found".
- Open
http://localhost:8080/apps/procest (no trailing slash) — the dashboard renders correctly.
- Same behaviour for
/index.php/apps/procest/ vs /index.php/apps/procest.
Root cause
appinfo/routes.php declares two routes named dashboard#page:
['name' => 'dashboard#page', 'url' => '/', 'verb' => 'GET'],
// …
// SPA catch-all — serves the Vue app for any frontend route (history mode).
['name' => 'dashboard#page', 'url' => '/{path}', 'verb' => 'GET', 'requirements' => ['path' => '.+'], 'defaults' => ['path' => '']],
Nextcloud's route loader keys by name, so only the last entry is registered. occ route:list confirms this — only procest.dashboard.page → /apps/procest/{path} is present, the / route is dropped. The catch-all's {path} requirement is .+ so empty path doesn't match either despite the 'defaults' => ['path' => ''] hint, so an exact / returns 404 while <no-slash> falls through to the controller's default $path=''.
Suggested fix
Either:
- Drop the duplicate
/ route (the catch-all already handles bare app root once the requirement is loosened to .*), or
- Keep both routes but rename one (e.g.
dashboard#root vs dashboard#page).
Workaround in the capture spec (#437): go() strips trailing slashes before navigation.
Companion finding
While debugging this I also hit a separate (harmless on this URL but real) PHP error: @SuppressWarnings(PHPMD.UnusedFormalParameter) on DashboardController::page() triggers Undefined array key 1 in NC's ControllerMethodReflector (line 41 in lib/private/AppFramework/Utility/ControllerMethodReflector.php), because the annotation isn't in key=value form. Worth either rewriting the annotation as @SuppressWarnings("PHPMD.UnusedFormalParameter") or removing it.
While building the journeydoc capture spec (#437) I discovered the Procest SPA shell does not resolve when the URL has a trailing slash.
Repro
http://localhost:8080/apps/procest/(with trailing slash) — Nextcloud renders "Page not found".http://localhost:8080/apps/procest(no trailing slash) — the dashboard renders correctly./index.php/apps/procest/vs/index.php/apps/procest.Root cause
appinfo/routes.phpdeclares two routes nameddashboard#page:Nextcloud's route loader keys by
name, so only the last entry is registered.occ route:listconfirms this — onlyprocest.dashboard.page→/apps/procest/{path}is present, the/route is dropped. The catch-all's{path}requirement is.+so empty path doesn't match either despite the'defaults' => ['path' => '']hint, so an exact/returns 404 while<no-slash>falls through to the controller's default$path=''.Suggested fix
Either:
/route (the catch-all already handles bare app root once the requirement is loosened to.*), ordashboard#rootvsdashboard#page).Workaround in the capture spec (#437):
go()strips trailing slashes before navigation.Companion finding
While debugging this I also hit a separate (harmless on this URL but real) PHP error:
@SuppressWarnings(PHPMD.UnusedFormalParameter)onDashboardController::page()triggersUndefined array key 1in NC'sControllerMethodReflector(line 41 inlib/private/AppFramework/Utility/ControllerMethodReflector.php), because the annotation isn't inkey=valueform. Worth either rewriting the annotation as@SuppressWarnings("PHPMD.UnusedFormalParameter")or removing it.