Pressing the back button after starting a process leaves you stuck in a redirection loop
- Create and start a workers process.
- Use your browser's back button.
- Watch as you get a Not found page, the path part of the URL is removed, and you get a "This process is not configurable" error.
- You cannot use your browser's next button.
- Use the back button again.
- Watch the notification again.
- You're stuck in here forever.
- Question your entire existence.
- Cry.
Redirecting like this to error pages can only be done using vue-router navigation guards, but the vue/Process/Filter.vue
and vue/Process/Configure.vue
both use the Vue created
hook. Using the Vue created
hook is in general a bad practice as it means you are probably doing some very strange hacks, and in the context of this hook, it is not possible to straight up reject a navigation, as the method is trying to do.
Unfortunately, using a navigation guard would also mean we would need to show some sort of loading state during route navigation, something that vue-router is not designed for. We can instead just not use any kind of router redirection, and instead display the normal title (like "Configure this process" or "Filter process elements"), with a red alert spanning the whole width of the screen and explaining that you can't configure this process as it was already started or as it isn't of the correct type.