Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove one query in MaintenanceTasks::TasksController#show #677

Closed
etiennebarrie opened this issue Jul 28, 2022 · 0 comments · Fixed by #737
Closed

Remove one query in MaintenanceTasks::TasksController#show #677

etiennebarrie opened this issue Jul 28, 2022 · 0 comments · Fixed by #737
Milestone

Comments

@etiennebarrie
Copy link
Member

Maybe we could pass the cursor to the task data, and it would build the RunsPage, that way we would load the active runs, load the paginated completed runs, and if we don't have any of these, we could cause the 404. Alternatively we could add a line to the controller, so that the exception leading to the 404 is raised at the end of the controller action, once we know if there's any run or not because we've loaded the active and completed runs.
[These two solutions would add a 404 where there's not now: if you "paginate" past the last cursor of a deleted task, right now we will find the last run and show it at the top anyway, but if we only rely on loaded data to know whether to 404, we will get a 404. But it's not much of a problem, the pagination would never get you there, only by changing the cursor in the URL to a value before which there's no run would you get that 404.]

#667 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant