lightning icon indicating copy to clipboard operation
lightning copied to clipboard

Render 404 page when no workflow snapshot is found

Open elias-ba opened this issue 1 year ago • 3 comments

When visiting the workflow edit page, one can pass a URL parameter to control the loaded snapshot version. That parameter is v, and it expects a positive integer value. That value is then queried in the database to find the associated workflow snapshot. When no snapshot is found, the app crashes. Instead of the app crashing we should return a 404 page.

elias-ba avatar Jul 09 '24 19:07 elias-ba

@elias-ba My recommendation for this will be to default to the latest version of the workflow rather than showing the user a 404 page. The users don't know about the lock version and showing them a 404 does not help them debug the issue.

christad92 avatar Jul 10 '24 08:07 christad92

@christad92 good point, but the only reason why I still think it's a 404 is because all of this is happening thru the URL. If we decide to default to the latest version we would be deciding to serve the user something they didn't order at all. It looks to me like I order a Bouye, and you don't have a Bouye and you serve me a Vodka. The muslim of me would be very angry 😆. Anyway I really think when the user types a non existent lock_version we should just say no ressource is associated to this URL. @taylordowns2000 @stuartc what you guys think ?

elias-ba avatar Jul 10 '24 09:07 elias-ba

Agreed. Forgetting costs for a second and trying to bring together some valid points from Stu, Elias, and Ayo:

  1. Parameters are never required. They're optional and additive. If the base URL exists, then load something and don't throw a 404.
  2. If an invalid parameter is added, it's often ignored (e.g., s="123" where there is no job "123" to show should load the canvas with no open panel.)
  3. In this particular case, if you want the workflow with snapshot "14" and there is none, we should either
    • make the snapshot part of the URL, not a parameter (I don't think we want to do this) then show a 404
    • or load the canvas and show a little modal that says, "We can't find a version 14 of this workflow. Click here to view the latest"

Either way, i'd put this fairly low on the backlog

taylordowns2000 avatar Jul 10 '24 09:07 taylordowns2000