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

Handle 404 properly #1179

Merged
merged 9 commits into from
Aug 2, 2016
Merged

Handle 404 properly #1179

merged 9 commits into from
Aug 2, 2016

Conversation

Calvinp
Copy link
Contributor

@Calvinp Calvinp commented Jul 29, 2016

Handles 404s on pages for specific requests, deploys, and tasks by showing the 404 page rather than rendering something meaningless and showing an error.

The following pages are affected:

  • DeployDetail
  • RequestDetail
  • TaskDetail
  • New Deploy Form
  • Edit Request Form

Please let me know if I've missed any @tpetr @kwm4385 @wolfd

@Calvinp
Copy link
Contributor Author

Calvinp commented Jul 29, 2016

Looks like it's not going to be possible to detect 404 on Task Search right now.
The server responds with an empty array rather than a 404, even when using the /request/:requestId/task-search URL.
@ssalinas a possible future improvement to the Task Search API would be to 404 when the request isn't found in this case.

@tpetr @kwm4385 @wolfd This PR is good to be reviewed/merged from my perspective now.

@Calvinp Calvinp changed the title Handle 404 properly (WIP) Handle 404 properly Jul 29, 2016
url: `/history/task/${taskId}`
(taskId, isMainApiCall) => ({
url: `/history/task/${taskId}`,
isMainApiCall
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the meaning snuck into another PR - that's on me, I implemented it with the Deploy Detail page fixes.
It's basically an idiomatic way of saying it ignores 404s. It signifies that if the API call fails with a 404 then the page should 404 (but it can also be extended to mean other things later).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isMainApiCall doesn't convey that information at all -- if that's all that this variable controls, can we think of a more descriptive name for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming things isn't my strong suit. Maybe pageCantRenderIfThisFails? I don't really like that name either though.

Copy link
Contributor Author

@Calvinp Calvinp Aug 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or page404sIfThis404s.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's cool, naming is hard 😄 -- I'd suggest something like renderNotFoundIf404

@wolfd
Copy link
Contributor

wolfd commented Aug 2, 2016

LGTM

1 similar comment
@tpetr
Copy link
Contributor

tpetr commented Aug 2, 2016

LGTM

@Calvinp Calvinp merged commit 373ac53 into decaf Aug 2, 2016
@Calvinp Calvinp deleted the handle_404_properly branch August 2, 2016 13:57
@tpetr tpetr modified the milestone: 0.10.0 Aug 18, 2016
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 this pull request may close these issues.

3 participants